(reader)
| 4799 | throw err; |
| 4800 | } |
| 4801 | } |
| 4802 | } |
| 4803 | var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/; |
| 4804 | function isomorphicEncode(input) { |
| 4805 | assert(!invalidIsomorphicEncodeValueRegex.test(input)); |
| 4806 | return input; |
| 4807 | } |
| 4808 | function readAllBytes(reader) { |
| 4809 | return __async(this, null, function* () { |
| 4810 | const bytes = []; |
| 4811 | let byteLength = 0; |
| 4812 | while (true) { |
| 4813 | const { done, value: chunk } = yield reader.read(); |
| 4814 | if (done) { |
| 4815 | return Buffer.concat(bytes, byteLength); |
| 4816 | } |
| 4817 | if (!isUint8Array(chunk)) { |
| 4818 | throw new TypeError("Received non-Uint8Array chunk"); |
| 4819 | } |
| 4820 | bytes.push(chunk); |
no test coverage detected