MCPcopy
hub / github.com/Effect-TS/effect / entries

Function entries

packages/platform-node-shared/test/Sink.test.ts:125–151  ·  view source on GitHub ↗
(
  input: Stream.Stream<Uint8Array, E, R>
)

Source from the content-addressed store, hash-verified

123}
124
125const entries = <R, E>(
126 input: Stream.Stream<Uint8Array, E, R>
127): Stream.Stream<Tar.ReadEntry, TarError | E, R> =>
128 Stream.suspend(() => {
129 const parser = new Tar.Parse()
130
131 const entries = Stream.async<Tar.ReadEntry, TarError>((emit) => {
132 parser.on("entry", (entry) => {
133 emit.single(entry)
134 })
135 parser.on("close", () => {
136 emit.end()
137 })
138 })
139
140 const pump = input.pipe(
141 Stream.run(
142 NodeSink.fromWritable(
143 () => parser,
144 (error) => new TarError({ error })
145 )
146 ),
147 Stream.zipRight(Stream.empty)
148 )
149
150 return Stream.merge(entries, pump)
151 })

Callers 1

Sink.test.tsFile · 0.70

Calls 5

mergeMethod · 0.80
singleMethod · 0.65
endMethod · 0.65
pipeMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected