MCPcopy Index your code
hub / github.com/nodejs/node / collectASequenceOfCodePointsFast

Function collectASequenceOfCodePointsFast

lib/internal/data_url.js:164–175  ·  view source on GitHub ↗

* A faster collectASequenceOfCodePoints that only works when comparing a single character. * @param {string} char * @param {string} input * @param {{ position: number }} position * @returns {string}

(char, input, position)

Source from the content-addressed store, hash-verified

162 * @returns {string}
163 */
164function collectASequenceOfCodePointsFast(char, input, position) {
165 const idx = StringPrototypeIndexOf(input, char, position.position);
166 const start = position.position;
167
168 if (idx === -1) {
169 position.position = input.length;
170 return StringPrototypeSlice(input, start);
171 }
172
173 position.position = idx;
174 return StringPrototypeSlice(input, start, position.position);
175}
176
177// https://url.spec.whatwg.org/#string-percent-decode
178/**

Callers 1

dataURLProcessorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…