isProperSubclassOf Function

Check if class subclass is a different class from superclass but extends from superclass

isProperSubclassOf<SuperClass extends (...: any[]) => any, NonSubClass extends (...: any[]) => any, SubClass extends (..._: any[]) => InstanceType<SuperClass>>(subclass: NonSubClass | SubClass, superclass: SuperClass): subclass is SubClass

@note The constructors of all types must be public.

@returns whether subclass is a proper subclass of superclass

Parameter Type Description
subclass NonSubClass | SubClass the class that may be a subclass of superclass
superclass SuperClass the class that may be a base class of subclass

Returns - subclass is SubClass

whether subclass is a proper subclass of superclass

Defined in

Last Updated: 03 May, 2024