Add usage examples

This commit is contained in:
Itai Steinherz 2018-12-09 15:43:52 +02:00 committed by GitHub
parent 9c103728fa
commit 599eb7fd34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -261,6 +261,16 @@ Returns `true` if `value` is a URL string.
Note: this only does basic checking using the [`URL` class](https://developer.mozilla.org/en-US/docs/Web/API/URL) constructor.
```js
const url = 'https://example.com';
is.url(url);
//=> true
is.url(new URL(url));
//=> false
```
##### .truthy(value)
Returns `true` for all values that evaluate to true in a boolean context: