(reader)
| 50981 | } |
| 50982 | } |
| 50983 | function isomorphicEncode(input) { |
| 50984 | for (let i3 = 0; i3 < input.length; i3++) { |
| 50985 | assert2(input.charCodeAt(i3) <= 255); |
| 50986 | } |
| 50987 | return input; |
| 50988 | } |
| 50989 | async function readAllBytes(reader) { |
| 50990 | const bytes = []; |
| 50991 | let byteLength = 0; |
| 50992 | while (true) { |
| 50993 | const { done, value: chunk } = await reader.read(); |
| 50994 | if (done) { |
| 50995 | return Buffer.concat(bytes, byteLength); |
| 50996 | } |
| 50997 | if (!isUint8Array(chunk)) { |
| 50998 | throw new TypeError("Received non-Uint8Array chunk"); |
| 50999 | } |
| 51000 | bytes.push(chunk); |
no test coverage detected
searching dependent graphs…