method StreamClass.prototype.some
Private
StreamClass.prototype.some(predicate: (
value: T,
index: number
) => boolean | PromiseLike<boolean>
): Task<boolean, E>

Whether any value satisfies predicate — short-circuiting: the source is not pulled past the first match. JS's name for Elixir's Enum.any?/2 and Rust's StreamExt::any.

Fail-fast like the other terminals: a failure element rejects, because a stream that could not produce one of its values cannot honestly answer a question about all of them.

await Stream.from([1, 2, 3]).some((n) => n > 2); // true

Parameters

predicate: (
value: T,
index: number
) => boolean | PromiseLike<boolean>

Return Type

Task<boolean, E>

Usage

import { StreamClass } from "lib/stream/stream.ts";