MCPcopy Create free account
hub / github.com/nodejs/node / bufferStartsWith

Function bufferStartsWith

deps/undici/undici.js:6624–6634  ·  view source on GitHub ↗
(buffer, start, position)

Source from the content-addressed store, hash-verified

6622 }
6623 __name(removeChars, "removeChars");
6624 function bufferStartsWith(buffer, start, position) {
6625 if (buffer.length < start.length) {
6626 return false;
6627 }
6628 for (let i = 0; i < start.length; i++) {
6629 if (start[i] !== buffer[position.position + i]) {
6630 return false;
6631 }
6632 }
6633 return true;
6634 }
6635 __name(bufferStartsWith, "bufferStartsWith");
6636 function parsingError(cause) {
6637 return new TypeError("Failed to parse body as FormData.", { cause: new TypeError(cause) });

Callers 1

multipartFormDataParserFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected