This function detects ES6 native classes, but also ES5-style emmulated
classes, if they're either a subclass (i.e. inherit from something other than
Object), or a base class with public instance methods or other property
descriptors on its prototype.
It has NO false positives: if it returns true, the thing is definitely a
class by the above rules. But it can return a false negative for a plain
constructor function with no base class and no prototype methods.
Is the given value a class?
This function detects ES6 native classes, but also ES5-style emmulated classes, if they're either a subclass (i.e. inherit from something other than Object), or a base class with public instance methods or other property descriptors on its prototype.
It has NO false positives: if it returns true, the thing is definitely a class by the above rules. But it can return a false negative for a plain constructor function with no base class and no prototype methods.