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

Function getRelativePathFromDirectory

test/fixtures/snapshot/typescript.js:8174–8180  ·  view source on GitHub ↗
(fromDirectory, to, getCanonicalFileNameOrIgnoreCase)

Source from the content-addressed store, hash-verified

8172 }
8173 ts.getPathComponentsRelativeTo = getPathComponentsRelativeTo;
8174 function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
8175 ts.Debug.assert((getRootLength(fromDirectory) > 0) === (getRootLength(to) > 0), "Paths must either both be absolute or both be relative");
8176 var getCanonicalFileName = typeof getCanonicalFileNameOrIgnoreCase === "function" ? getCanonicalFileNameOrIgnoreCase : ts.identity;
8177 var ignoreCase = typeof getCanonicalFileNameOrIgnoreCase === "boolean" ? getCanonicalFileNameOrIgnoreCase : false;
8178 var pathComponents = getPathComponentsRelativeTo(fromDirectory, to, ignoreCase ? ts.equateStringsCaseInsensitive : ts.equateStringsCaseSensitive, getCanonicalFileName);
8179 return getPathFromPathComponents(pathComponents);
8180 }
8181 ts.getRelativePathFromDirectory = getRelativePathFromDirectory;
8182 function convertToRelativePath(absoluteOrRelativePath, basePath, getCanonicalFileName) {
8183 return !isRootedDiskPath(absoluteOrRelativePath)

Callers 1

getRelativePathFromFileFunction · 0.85

Calls 4

getRootLengthFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…