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

Function collectAllUntil

packages/effect/src/internal/sink.ts:178–187  ·  view source on GitHub ↗
(p: Predicate<In>)

Source from the content-addressed store, hash-verified

176
177/** @internal */
178export const collectAllUntil = <In>(p: Predicate<In>): Sink.Sink<Chunk.Chunk<In>, In, In> => {
179 return pipe(
180 fold<[Chunk.Chunk<In>, boolean], In>(
181 [Chunk.empty(), true],
182 (tuple) => tuple[1],
183 ([chunk, _], input) => [pipe(chunk, Chunk.append(input)), !p(input)]
184 ),
185 map((tuple) => tuple[0])
186 )
187}
188
189/** @internal */
190export const collectAllUntilEffect = <In, E, R>(p: (input: In) => Effect.Effect<boolean, E, R>) => {

Callers

nothing calls this directly

Calls 4

foldFunction · 0.85
pipeFunction · 0.70
pFunction · 0.50
mapFunction · 0.50

Tested by

no test coverage detected