Add is.urlInstance (#60)

This commit is contained in:
Artur Androsovych 2018-07-10 12:04:20 +03:00 committed by Sindre Sorhus
parent c8736c2972
commit 3bdaf21475
3 changed files with 23 additions and 1 deletions

View file

@ -176,6 +176,17 @@ is.directInstanceOf(new UnicornError(), Error);
//=> false
```
##### .urlInstance(value)
Returns `true` if `value` is an instance of the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL).
```js
const url = new URL('https://example.com');
is.urlInstance(url);
//=> true
```
##### .truthy(value)
Returns `true` for all values that evaluate to true in a boolean context: