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

Function tryUpdateString

test/fixtures/snapshot/typescript.js:139525–139535  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

139523 return foundExactMatch;
139524 }
139525 function tryUpdateString(element) {
139526 if (!ts.isStringLiteral(element))
139527 return false;
139528 var elementFileName = combinePathsSafe(configDir, element.text);
139529 var updated = oldToNew(elementFileName);
139530 if (updated !== undefined) {
139531 changeTracker.replaceRangeWithText(configFile, createStringRange(element, configFile), relativePath(updated));
139532 return true;
139533 }
139534 return false;
139535 }
139536 function relativePath(path) {
139537 return ts.getRelativePathFromDirectory(configDir, path, /*ignoreCase*/ !useCaseSensitiveFileNames);
139538 }

Callers 2

updateTsconfigFilesFunction · 0.85
updatePathsFunction · 0.85

Calls 3

combinePathsSafeFunction · 0.85
createStringRangeFunction · 0.85
relativePathFunction · 0.70

Tested by

no test coverage detected