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

Function shouldBeTreatedAsRelativeOrAbsolutePath

lib/internal/modules/esm/resolve.js:831–835  ·  view source on GitHub ↗

* Determines whether a specifier should be treated as a relative or absolute path. * @param {string} specifier - The specifier to check. * @returns {boolean}

(specifier)

Source from the content-addressed store, hash-verified

829 * @returns {boolean}
830 */
831function shouldBeTreatedAsRelativeOrAbsolutePath(specifier) {
832 if (specifier === '') { return false; }
833 if (specifier[0] === '/') { return true; }
834 return isRelativeSpecifier(specifier);
835}
836
837/**
838 * Resolves a module specifier to a URL.

Callers 2

moduleResolveFunction · 0.85
defaultResolveFunction · 0.85

Calls 1

isRelativeSpecifierFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…