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

Function bufferStartsWith

github-actions/saucelabs/set-saucelabs-env.js:5559–5569  ·  view source on GitHub ↗
(buffer, start, position)

Source from the content-addressed store, hash-verified

5557 while (lead < buf.length && predicate(buf[lead]))
5558 lead++;
5559 }
5560 if (trailing) {
5561 while (trail > 0 && predicate(buf[trail]))
5562 trail--;
5563 }
5564 return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1);
5565 }
5566 function bufferStartsWith(buffer, start, position) {
5567 if (buffer.length < start.length) {
5568 return false;
5569 }
5570 for (let i = 0; i < start.length; i++) {
5571 if (start[i] !== buffer[position.position + i]) {
5572 return false;

Callers 2

multipartFormDataParserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected