Meta Type Narrowing
class Model {
static isModel(object: any): object is Model { // `object` is an instance of `Model` class, if...
return !!object && // It is truthy AND...
!!object.__proto__.constructor.isModel && // It contains a static property with the same name as this function AND...
typeof object.__proto__.constructor.isModel === "function"; // That static property is a function.
}
}