1.0.1 • Published 9 years ago
@iterables/any v1.0.1
@iterables/any
Return true if any element of an iterable matches.
const any = require('@iterables/any')
any('abc', xs => xs === 'c') // true
any('abc', xs => xs === 'd') // false
any([null, false, '']) // false
any([null, false, {}]) // trueInstallation
$ npm install --save @iterables/anyAPI
any(iterable, test = Boolean) -> Iterator
iterable: anyIterator— a generator instance,Array,Map,String, orSettest: A function takingxsand returning a boolean value.
Returns true if any element matched test, or false if no element matched.
Stops consuming elements from iterable as soon as they pass test.
License
MIT
1.0.1
9 years ago