every: (fn: Function, iterator: Iterable) => boolean
Returns a boolean indicating whether or not all values in the iterator
passes the predicate function.
asyncEvery: (fn: Function, iterator: AsyncIterable) => Promise
Same as every
, but works with AsyncGenerators and async predicate
functions.
some: (fn: Function, iterator: Iterable) => boolean
Returns a boolean indicating whether or not there exists a value in the
iterator that passes the predicate function.
asyncSome: (fn: Function, iterator: AsyncIterable) => Promise
Same as some
, but works with AsyncGenerators and async predicate
functions.
count: (iterator: Iterable) => number
Returns the number of items in the iterator.
asyncCount: (iterator: AsyncIterable) => Promise
Same as count
, but works with AsyncGenerators.
collectArray: (iterator: Iterable) => Array;
Collect all the items in the iterator into an array.
asyncCollectArray: (iterator: AsyncIterable) => Promise;
Same as collectArray
, but works with AsyncGenerators.
collectSet: (iterator: Iterable) => Set;
Collect all the items in the iterator into a Set.
asyncCollectSet: (iterator: AsyncIterable) => Promise;
Same as collectSet
, but works with AsyncGenerators.
collectMap: (iterator: Iterable) => Map;
Collect all the key/value tuples in the iterator into a Map.
asyncCollectMap: (iterator: AsyncIterable) => Promise;
Same as collectMap
, but works with AsyncGenerators.
collectObject: (iterator: Iterable) => Object;
Collect all the key/value tuples in the iterator into an Object.
asyncCollectObject: (iterator: AsyncIterable) => Promise;
Same as collectObject
, but works with AsyncGenerators.
join: (separator: string, iterator: Iterable) => string;
Collect all the items in the iterator into a string separated by the
separator token.
asyncJoin: (separator: string, iterator: AsyncIterable) => Promise;
Same as join
, but works with AsyncGenerators.
pipe: (iterator: Iterable | AsyncIterable, ...fns: Function) => any;
Starting with an iterator, apply any number of functions to transform the
values and return the result.
Contributing
Tests
Run the tests
npm test
Run the tests with a continuous test runner
npm test -- --watch