Skip to content

fx-flow v0.7.0 / pipe/strict / every

Function: every()

every(fn, iterable)

every<A>(fn, iterable): true

Returns true if all values in Iterable/AsyncIterable pass the fn truth test.

Type parameters

A extends readonly []

Parameters

fn

iterable: A

Returns

true

Example

typescript
every((a) => a % 2 === 0, [2, 4, 6, 8, 10])
// true

every((a) => a % 2 === 0, [2, 5, 6, 7, 10])
// false

More examples

Source

packages/core/src/pipe/strict/every.ts:23

every(fn, iterable)

every<A>(fn, iterable): boolean

Type parameters

A

Parameters

fn

iterable: Iterable<A>

Returns

boolean

Source

packages/core/src/pipe/strict/every.ts:25

every(fn, iterable)

every<A>(fn, iterable): Promise<boolean>

Type parameters

A

Parameters

fn

iterable: AsyncIterable<A>

Returns

Promise<boolean>

Source

packages/core/src/pipe/strict/every.ts:26

every(fn)

every<A>(fn): (iterable) => IterableReturnValue<A, boolean>

Type parameters

A extends UniversalIterable

Parameters

fn

Returns

Function

Parameters

iterable: A

Returns

IterableReturnValue<A, boolean>

Source

packages/core/src/pipe/strict/every.ts:28

Released under the MIT License.