(chunk)
| 46 | // Stream chunks may be strings (e.g. a ReadableStream or Node stream that wasn't |
| 47 | // fed bytes); encode them so they aren't coerced to zero bytes by Uint8Array.set. |
| 48 | function toUint8Array(chunk) { |
| 49 | return typeof chunk === 'string' ? new TextEncoder().encode(chunk) : new Uint8Array(chunk); |
| 50 | } |
| 51 | |
| 52 | function concatUint8Arrays(chunks) { |
| 53 | const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0); |
no outgoing calls
no test coverage detected
searching dependent graphs…