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

Function collectASequenceOfBytes

deps/undici/src/lib/web/fetch/formdata-parser.js:475–483  ·  view source on GitHub ↗

* @param {(char: number) => boolean} condition * @param {Buffer} input * @param {{ position: number }} position

(condition, input, position)

Source from the content-addressed store, hash-verified

473 * @param {{ position: number }} position
474 */
475function collectASequenceOfBytes (condition, input, position) {
476 let start = position.position
477
478 while (start < input.length && condition(input[start])) {
479 ++start
480 }
481
482 return input.subarray(position.position, (position.position = start))
483}
484
485/**
486 * @param {Buffer} buf

Callers 2

Calls 1

conditionFunction · 0.50

Tested by

no test coverage detected