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

Function getRootLength

test/fixtures/snapshot/typescript.js:7736–7739  ·  view source on GitHub ↗

* Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). * * For example: * ```ts * getRootLength("a") === 0 // "" * getRootLength("/") === 1 // "/" * getRootLength("c:") =

(path)

Source from the content-addressed store, hash-verified

7734 * ```
7735 */
7736 function getRootLength(path) {
7737 var rootLength = getEncodedRootLength(path);
7738 return rootLength < 0 ? ~rootLength : rootLength;
7739 }
7740 ts.getRootLength = getRootLength;
7741 function getDirectoryPath(path) {
7742 path = normalizeSlashes(path);

Callers 6

getDirectoryPathFunction · 0.85
getBaseFileNameFunction · 0.85
getPathComponentsFunction · 0.85
combinePathsFunction · 0.85
comparePathsWorkerFunction · 0.85

Calls 1

getEncodedRootLengthFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…