( input: Stream.Stream<Uint8Array, E, R> )
| 125 | }> {} |
| 126 | |
| 127 | const entries = <R, E>( |
| 128 | input: Stream.Stream<Uint8Array, E, R> |
| 129 | ): Stream.Stream<Tar.ReadEntry, TarError | E, R> => |
| 130 | Effect.gen(function*() { |
| 131 | const parser = new Tar.Parser() |
| 132 | |
| 133 | yield* input.pipe( |
| 134 | Stream.run( |
| 135 | NodeSink.fromWritable({ |
| 136 | evaluate: () => parser, |
| 137 | onError: (error) => new TarError({ error }) |
| 138 | }) |
| 139 | ), |
| 140 | Effect.forkScoped |
| 141 | ) |
| 142 | |
| 143 | return Stream.callback<Tar.ReadEntry, TarError>((queue) => |
| 144 | Effect.sync(() => { |
| 145 | parser.on("entry", (entry) => { |
| 146 | Queue.offerUnsafe(queue, entry) |
| 147 | }) |
| 148 | parser.on("close", () => { |
| 149 | Queue.endUnsafe(queue) |
| 150 | }) |
| 151 | }) |
| 152 | ) |
| 153 | }).pipe(Stream.unwrap) |
no test coverage detected