isSubclass
Available since v0.9
Determine if target class is a subclass (child class) of given superclass (parent class).
It accepts the following arguments:
target: object
- The target.superclass: ConstructorOrAbstractConstructor
- The superclass.
import { isSubclass } from '@aedart/support/reflections';
class A {}
class B extends A {}
isSubclass({}, A); // false
isSubclass(A, A); // false
isSubclass(A, B); // false
isSubclass(B, A); // true