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

Function fullyReadBody

github-actions/browserstack/set-browserstack-env.js:4764–4781  ·  view source on GitHub ↗
(body, processBody, processBodyError)

Source from the content-addressed store, hash-verified

4762 }));
4763 }
4764 function fullyReadBody(body, processBody, processBodyError) {
4765 return __async(this, null, function* () {
4766 const successSteps = processBody;
4767 const errorSteps = processBodyError;
4768 let reader;
4769 try {
4770 reader = body.stream.getReader();
4771 } catch (e) {
4772 errorSteps(e);
4773 return;
4774 }
4775 try {
4776 successSteps(yield readAllBytes(reader));
4777 } catch (e) {
4778 errorSteps(e);
4779 }
4780 });
4781 }
4782 function isReadableStreamLike(stream) {
4783 return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function";
4784 }

Callers 2

consumeBodyFunction · 0.70
mainFetchFunction · 0.70

Calls 4

__asyncFunction · 0.70
errorStepsFunction · 0.70
successStepsFunction · 0.70
readAllBytesFunction · 0.70

Tested by

no test coverage detected