Add usage examples
This commit is contained in:
parent
9c103728fa
commit
599eb7fd34
1 changed files with 10 additions and 0 deletions
10
readme.md
10
readme.md
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue