forked from orbit-oss/is
Add is.urlString (#73)
This commit is contained in:
parent
2ee148f5a1
commit
566f363632
3 changed files with 40 additions and 1 deletions
16
readme.md
16
readme.md
|
|
@ -255,6 +255,22 @@ is.urlInstance(url);
|
|||
//=> true
|
||||
```
|
||||
|
||||
### .url(value)
|
||||
|
||||
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