MCPcopy Create free account
hub / github.com/Effect-TS/effect / find

Function find

packages/effect/src/Sink.ts:1571–1576  ·  view source on GitHub ↗
(predicate: Predicate<In>)

Source from the content-addressed store, hash-verified

1569 <In, Out extends In>(refinement: Refinement<In, Out>): Sink<Option.Option<Out>, In, In>
1570 <In>(predicate: Predicate<In>): Sink<Option.Option<In>, In, In>
1571} = <In>(predicate: Predicate<In>): Sink<Option.Option<In>, In, In> =>
1572 reduceWhile(
1573 Option.none<In>,
1574 Option.isNone,
1575 (acc, in_) => predicate(in_) ? Option.some(in_) : acc
1576 )
1577
1578/**
1579 * Creates a sink containing the first value matched by an effectful predicate.

Callers

nothing calls this directly

Calls 3

reduceWhileFunction · 0.85
predicateFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected