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

Function partStartsWith

test/fixtures/snapshot/typescript.js:142570–142574  ·  view source on GitHub ↗
(candidate, candidateSpan, pattern, ignoreCase, patternSpan)

Source from the content-addressed store, hash-verified

142568 : ts.compareValues(a.kind, b.kind) || ts.compareBooleans(!a.isCaseSensitive, !b.isCaseSensitive);
142569 }
142570 function partStartsWith(candidate, candidateSpan, pattern, ignoreCase, patternSpan) {
142571 if (patternSpan === void 0) { patternSpan = { start: 0, length: pattern.length }; }
142572 return patternSpan.length <= candidateSpan.length // If pattern part is longer than the candidate part there can never be a match.
142573 && everyInRange(0, patternSpan.length, function (i) { return equalChars(pattern.charCodeAt(patternSpan.start + i), candidate.charCodeAt(candidateSpan.start + i), ignoreCase); });
142574 }
142575 function equalChars(ch1, ch2, ignoreCase) {
142576 return ignoreCase ? toLowerCase(ch1) === toLowerCase(ch2) : ch1 === ch2;
142577 }

Callers 2

matchTextChunkFunction · 0.85
tryCamelCaseMatchFunction · 0.85

Calls 2

everyInRangeFunction · 0.85
equalCharsFunction · 0.85

Tested by

no test coverage detected