()
| 101 | |
| 102 | // Re-feed the sniffed prefix, then drain the rest of the source into the parser. |
| 103 | async function* rejoin() { |
| 104 | for (const chunk of sniffed) yield chunk |
| 105 | while (true) { |
| 106 | const { value, done } = await reader.next() |
| 107 | if (done) return |
| 108 | yield value |
| 109 | } |
| 110 | } |
| 111 | const piped = Readable.from(rejoin()) |
| 112 | piped.on('error', (err) => parser.destroy(err)) |
| 113 | piped.pipe(parser) |
no outgoing calls
no test coverage detected