Add is.directInstanceOf()

This commit is contained in:
Brandon Smith 2017-12-09 00:01:39 -05:00
parent 4ce2ee9d39
commit fe344fd7eb
3 changed files with 27 additions and 0 deletions

View file

@ -136,6 +136,20 @@ is.boundFunction(function () {});
#### Miscellaneous
##### .directInstanceOf(value, klass)
Returns `true` if value is a direct instance of a class of type `klass`.
```js
class ErrorSubclass extends Error {};
is.directInstanceOf(new Error(), Error);
//=> true
is.directInstanceOf(new ErrorSubclass(), Error);
//=> false
```
##### .truthy(value)
Returns `true` for all values that evaluate to true in a boolean context: