forked from orbit-oss/is
Add is.any() and is.all() methods (#19)
This commit is contained in:
parent
75ac3cd574
commit
651f434eab
3 changed files with 81 additions and 0 deletions
24
readme.md
24
readme.md
|
|
@ -158,6 +158,30 @@ Check if `value` is `Infinity` or `-Infinity`.
|
|||
Returns `true` if `value` is falsy or an empty string, array, object, map, or set.
|
||||
|
||||
|
||||
##### .any(predicate, ...values)
|
||||
|
||||
Returns `true` if **any** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.any(is.string, {}, true, '🦄');
|
||||
//=> true
|
||||
|
||||
is.any(is.boolean, 'unicorns', [], new Map());
|
||||
//=> false
|
||||
```
|
||||
|
||||
##### .all(predicate, ...values)
|
||||
|
||||
Returns `true` if **all** of the input `values` returns true in the `predicate`:
|
||||
|
||||
```js
|
||||
is.all(is.object, {}, new Map(), new Set());
|
||||
//=> true
|
||||
|
||||
is.all(is.string, '🦄', [], 'unicorns');
|
||||
//=> false
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why yet another type checking module?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue