Skip to content

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

Function: some()

some(fn)

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

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

Type parameters

A extends UniversalIterable

Parameters

fn

Returns

Function

Parameters

iterable: A

Returns

IterableReturnValue<A, boolean>

Example

typescript
some((a) => a % 2 !== 0, [2, 4, 6, 8, 10])
// false

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

More examples

Source

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

some(fn, iterable)

some<A>(fn, iterable): false

Type parameters

A extends readonly []

Parameters

fn

iterable: A

Returns

false

Source

packages/core/src/pipe/strict/some.ts:27

some(fn, iterable)

some<A>(fn, iterable): boolean

Type parameters

A

Parameters

fn

iterable: Iterable<A>

Returns

boolean

Source

packages/core/src/pipe/strict/some.ts:29

some(fn, iterable)

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

Type parameters

A

Parameters

fn

iterable: AsyncIterable<A>

Returns

Promise<boolean>

Source

packages/core/src/pipe/strict/some.ts:30

Released under the MIT License.