import { findFirst } from 'fp-ts/Array'
import { some } from 'fp-ts/Option'
type X = {
readonly a: number
readonly b: number
}
assert.deepStrictEqual(findFirst((x: X) => x.a === 1)([{ a: 1, b: 1 }, { a: 1, b: 2 }]), some({ a: 1, b: 1 }))
2.0.0
Find the first element which satisfies a predicate (or a refinement) function. It returns an
Option
containing the element orNone
if not found.