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

Function consumeStart

github-actions/browserstack/set-browserstack-env.js:9837–9863  ·  view source on GitHub ↗
(consume2)

Source from the content-addressed store, hash-verified

9835 });
9836 }
9837 function consumeStart(consume2) {
9838 if (consume2.body === null) {
9839 return;
9840 }
9841 const { _readableState: state } = consume2.stream;
9842 if (state.bufferIndex) {
9843 const start = state.bufferIndex;
9844 const end = state.buffer.length;
9845 for (let n = start; n < end; n++) {
9846 consumePush(consume2, state.buffer[n]);
9847 }
9848 } else {
9849 for (const chunk of state.buffer) {
9850 consumePush(consume2, chunk);
9851 }
9852 }
9853 if (state.endEmitted) {
9854 consumeEnd(this[kConsume]);
9855 } else {
9856 consume2.stream.on("end", function() {
9857 consumeEnd(this[kConsume]);
9858 });
9859 }
9860 consume2.stream.resume();
9861 while (consume2.stream.read() != null) {
9862 }
9863 }
9864 function chunksDecode(chunks, length) {
9865 if (chunks.length === 0 || length === 0) {
9866 return "";

Callers 1

consumeFunction · 0.70

Calls 4

consumePushFunction · 0.70
consumeEndFunction · 0.70
onMethod · 0.45
resumeMethod · 0.45

Tested by

no test coverage detected