Package: effect
Module: Array
Checks whether at least one element satisfies the predicate. Narrows the type
to NonEmptyReadonlyArray on success.
Example (Testing for any match)
import { Array } from "effect"
console.log(Array.some([1, 3, 4], (x) => x % 2 === 0)) // true
console.log(Array.some([1, 3, 5], (x) => x % 2 === 0)) // false
See
every — test if all elements matchcontains — test for a specific valueSignature
declare const some: { <A>(predicate: (a: NoInfer<A>, i: number) => boolean): (self: ReadonlyArray<A>) => self is NonEmptyReadonlyArray<A>; <A>(self: ReadonlyArray<A>, predicate: (a: A, i: number) => boolean): self is NonEmptyReadonlyArray<A>; }
Since v2.0.0