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