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

Function getFullMatch

test/fixtures/snapshot/typescript.js:142427–142447  ·  view source on GitHub ↗
(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans)

Source from the content-addressed store, hash-verified

142425 }
142426 ts.createPatternMatcher = createPatternMatcher;
142427 function getFullMatch(candidateContainers, candidate, dotSeparatedSegments, stringToWordSpans) {
142428 // First, check that the last part of the dot separated pattern matches the name of the
142429 // candidate. If not, then there's no point in proceeding and doing the more
142430 // expensive work.
142431 var candidateMatch = matchSegment(candidate, ts.last(dotSeparatedSegments), stringToWordSpans);
142432 if (!candidateMatch) {
142433 return undefined;
142434 }
142435 // -1 because the last part was checked against the name, and only the rest
142436 // of the parts are checked against the container.
142437 if (dotSeparatedSegments.length - 1 > candidateContainers.length) {
142438 // There weren't enough container parts to match against the pattern parts.
142439 // So this definitely doesn't match.
142440 return undefined;
142441 }
142442 var bestMatch;
142443 for (var i = dotSeparatedSegments.length - 2, j = candidateContainers.length - 1; i >= 0; i -= 1, j -= 1) {
142444 bestMatch = betterMatch(bestMatch, matchSegment(candidateContainers[j], dotSeparatedSegments[i], stringToWordSpans));
142445 }
142446 return bestMatch;
142447 }
142448 function getWordSpans(word, stringToWordSpans) {
142449 var spans = stringToWordSpans.get(word);
142450 if (!spans) {

Callers 1

createPatternMatcherFunction · 0.85

Calls 3

matchSegmentFunction · 0.85
betterMatchFunction · 0.85
lastMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…