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

Function isAbsolute

lib/path.js:487–500  ·  view source on GitHub ↗

* @param {string} path * @returns {boolean}

(path)

Source from the content-addressed store, hash-verified

485 * @returns {boolean}
486 */
487 isAbsolute(path) {
488 validateString(path, 'path');
489 const len = path.length;
490 if (len === 0)
491 return false;
492
493 const code = StringPrototypeCharCodeAt(path, 0);
494 return isPathSeparator(code) ||
495 // Possible device root
496 (len > 2 &&
497 isWindowsDeviceRoot(code) &&
498 StringPrototypeCharCodeAt(path, 1) === CHAR_COLON &&
499 isPathSeparator(StringPrototypeCharCodeAt(path, 2)));
500 },
501
502 /**
503 * @param {...string} args

Callers 10

convertCJSFilenameToURLFunction · 0.85
onChangedFunction · 0.85
runFunction · 0.85
sourcesToAbsoluteFunction · 0.85
shouldHandleMethod · 0.85
#toProviderPathMethod · 0.85
globSyncMethod · 0.85
onLinkFunction · 0.85
onLinkFunction · 0.85
normalizePathFunction · 0.85

Calls 2

isPathSeparatorFunction · 0.85
isWindowsDeviceRootFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…