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

Function consumeFinish

github-actions/browserstack/set-browserstack-env.js:9912–9927  ·  view source on GitHub ↗
(consume2, err)

Source from the content-addressed store, hash-verified

9910 return "";
9911 }
9912 const buffer = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, length);
9913 const bufferLength = buffer.length;
9914 const start = bufferLength > 2 && buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191 ? 3 : 0;
9915 return buffer.utf8Slice(start, bufferLength);
9916 }
9917 function chunksConcat(chunks, length) {
9918 if (chunks.length === 0 || length === 0) {
9919 return new Uint8Array(0);
9920 }
9921 if (chunks.length === 1) {
9922 return new Uint8Array(chunks[0]);
9923 }
9924 const buffer = new Uint8Array(Buffer.allocUnsafeSlow(length).buffer);
9925 let offset = 0;
9926 for (let i = 0; i < chunks.length; ++i) {
9927 const chunk = chunks[i];
9928 buffer.set(chunk, offset);
9929 offset += chunk.length;
9930 }

Callers 2

consumeFunction · 0.70
consumeEndFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected