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

Function emit

packages/effect/src/encoding/Xml.ts:942–958  ·  view source on GitHub ↗
(
        inputs: ReadonlyArray<In> | undefined
      )

Source from the content-addressed store, hash-verified

940
941 // Output completed before an error is emitted before the failure
942 const emit = (
943 inputs: ReadonlyArray<In> | undefined
944 ): Pull.Pull<Arr.NonEmptyReadonlyArray<Out>, XmlError | IE, Done> => {
945 try {
946 if (inputs === undefined) machine.end()
947 else for (let i = 0; i < inputs.length; i++) machine.push(inputs[i])
948 } catch (error) {
949 if (!isXmlError(error)) throw error
950 failure = error
951 }
952 const out = machine.out
953 if (Arr.isArrayNonEmpty(out)) {
954 machine.out = []
955 return Effect.succeed(out)
956 }
957 return pull
958 }
959
960 const step = Pull.matchEffect(upstream, {
961 onSuccess: emit,

Callers 1

makeChannelFunction · 0.70

Calls 4

isXmlErrorFunction · 0.85
endMethod · 0.65
pushMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected