(
inputs: ReadonlyArray<In> | undefined
)
| 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, |
no test coverage detected