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

Function getRelativePathToDirectoryOrUrl

test/fixtures/snapshot/typescript.js:8192–8200  ·  view source on GitHub ↗
(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl)

Source from the content-addressed store, hash-verified

8190 }
8191 ts.getRelativePathFromFile = getRelativePathFromFile;
8192 function getRelativePathToDirectoryOrUrl(directoryPathOrUrl, relativeOrAbsolutePath, currentDirectory, getCanonicalFileName, isAbsolutePathAnUrl) {
8193 var pathComponents = getPathComponentsRelativeTo(resolvePath(currentDirectory, directoryPathOrUrl), resolvePath(currentDirectory, relativeOrAbsolutePath), ts.equateStringsCaseSensitive, getCanonicalFileName);
8194 var firstComponent = pathComponents[0];
8195 if (isAbsolutePathAnUrl && isRootedDiskPath(firstComponent)) {
8196 var prefix = firstComponent.charAt(0) === ts.directorySeparator ? "file://" : "file:///";
8197 pathComponents[0] = prefix + firstComponent;
8198 }
8199 return getPathFromPathComponents(pathComponents);
8200 }
8201 ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
8202 function forEachAncestorDirectory(directory, callback) {
8203 while (true) {

Callers 1

convertToRelativePathFunction · 0.85

Calls 4

resolvePathFunction · 0.85
isRootedDiskPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…