MCPcopy Create free account
hub / github.com/angular/dev-infra / readAllBytes

Function readAllBytes

github-actions/saucelabs/set-saucelabs-env.js:4801–4817  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

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);

Callers 2

fullyReadBodyFunction · 0.70
putMethod · 0.70

Calls 2

__asyncFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected