Update readme.md
This commit is contained in:
parent
fe344fd7eb
commit
0abb71615c
1 changed files with 5 additions and 5 deletions
10
readme.md
10
readme.md
|
|
@ -136,17 +136,17 @@ is.boundFunction(function () {});
|
||||||
|
|
||||||
#### Miscellaneous
|
#### Miscellaneous
|
||||||
|
|
||||||
##### .directInstanceOf(value, klass)
|
##### .directInstanceOf(value, class)
|
||||||
|
|
||||||
Returns `true` if value is a direct instance of a class of type `klass`.
|
Returns `true` if `value` is a direct instance of `class`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
class ErrorSubclass extends Error {};
|
|
||||||
|
|
||||||
is.directInstanceOf(new Error(), Error);
|
is.directInstanceOf(new Error(), Error);
|
||||||
//=> true
|
//=> true
|
||||||
|
|
||||||
is.directInstanceOf(new ErrorSubclass(), Error);
|
class UnicornError extends Error {};
|
||||||
|
|
||||||
|
is.directInstanceOf(new UnicornError(), Error);
|
||||||
//=> false
|
//=> false
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue