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

x/ayonli_jsext/class.ts>isSubclassOf

A JavaScript extension package for building strong and modern applications.
Latest
function isSubclassOf
import { isSubclassOf } from "https://deno.land/x/ayonli_jsext@v0.9.72/class.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

Returns

boolean