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

Function emit

packages/effect/src/encoding/Ndjson.ts:208–212  ·  view source on GitHub ↗
(out: Array<unknown>, error: NdjsonError | undefined)

Source from the content-addressed store, hash-verified

206 let done: { readonly leftover: Done } | undefined
207
208 const emit = (out: Array<unknown>, error: NdjsonError | undefined) => {
209 failure = error
210 if (Arr.isArrayNonEmpty(out)) return Effect.succeed(out)
211 return error !== undefined ? Effect.fail(error) : undefined
212 }
213
214 const pull: Pull.Pull<Arr.NonEmptyReadonlyArray<unknown>, IE | NdjsonError, Done> = Effect.suspend(() => {
215 if (failure !== undefined) return Effect.fail(failure)

Callers 1

makeDecodePullFunction · 0.70

Calls 2

failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected