Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/mixins.ts>isSubclassOf

A JavaScript extension package for building strong and modern applications.
Latest
function isSubclassOf
Re-export
import { isSubclassOf } from "https://deno.land/x/ayonli_jsext@v0.9.72/mixins.ts";

Checks if a class is a subclass of another class.

Examples

Example 1

import { isSubclassOf } from "@ayonli/jsext/class";

class Moment extends Date {}

console.assert(isSubclassOf(Moment, Date));
console.assert(isSubclassOf(Moment, Object)); // all classes are subclasses of Object

Parameters

ctor1: Constructor<A>
ctor2: Constructor<B>

Returns

boolean