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

Function matchedText

test/fixtures/snapshot/typescript.js:2395–2398  ·  view source on GitHub ↗

* Given that candidate matches pattern, returns the text matching the '*'. * E.g.: matchedText(tryParsePattern("foo*baz"), "foobarbaz") === "bar"

(pattern, candidate)

Source from the content-addressed store, hash-verified

2393 * E.g.: matchedText(tryParsePattern("foo*baz"), "foobarbaz") === "bar"
2394 */
2395 function matchedText(pattern, candidate) {
2396 ts.Debug.assert(isPatternMatch(pattern, candidate));
2397 return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length);
2398 }
2399 ts.matchedText = matchedText;
2400 /** Return the object corresponding to the best pattern to match `candidate`. */
2401 function findBestPatternMatch(values, getPattern, candidate) {

Callers

nothing calls this directly

Calls 2

isPatternMatchFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…