Standard Array.every logic for the iterable, extended with iteration state + async.
It emits a boolean, indicating whether all elements pass the predicate test.
boolean
import {pipe, every} from 'iter-ops';const i = pipe( [1, 2, 3], every(a => a % 2 === 0) // checks if every number is even);console.log(...i); //=> falseconsole.log(i.first); //=> false Copy
import {pipe, every} from 'iter-ops';const i = pipe( [1, 2, 3], every(a => a % 2 === 0) // checks if every number is even);console.log(...i); //=> falseconsole.log(i.first); //=> false
Note that the predicate can only return a Promise inside an asynchronous pipeline, or else the Promise will be treated as a truthy value.
Promise
Standard Array.every logic for the iterable, extended with iteration state + async.
It emits a
boolean
, indicating whether all elements pass the predicate test.Note that the predicate can only return a
Promise
inside an asynchronous pipeline, or else thePromise
will be treated as a truthy value.