(stream: NodeJS.ReadableStream)
| 20 | // ── Helpers ─────────────────────────────────────────────────────────── |
| 21 | |
| 22 | async function streamToString(stream: NodeJS.ReadableStream): Promise<string> { |
| 23 | const chunks: Buffer[] = []; |
| 24 | for await (const chunk of stream) { |
| 25 | chunks.push(Buffer.from(chunk as Buffer)); |
| 26 | } |
| 27 | return Buffer.concat(chunks).toString('utf-8'); |
| 28 | } |
| 29 | |
| 30 | async function streamByteLength(stream: NodeJS.ReadableStream): Promise<number> { |
| 31 | let n = 0; |
no test coverage detected