How to validate that a value is an instance of a class

Is there a way (yet) to validate that a value is an instance of a class?

I know this doesn't work, but maybe it'll convey the idea:
class SomeClass {}
const someType = type(SomeClass)
someType.allows("abc") // false
someType.allows(new SomeClass()) // true
Was this page helpful?