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

Function isRelativeSpecifier

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

* Determines whether a specifier is a relative path. * @param {string} specifier - The specifier to check. * @returns {boolean}

(specifier)

Source from the content-addressed store, hash-verified

814 * @returns {boolean}
815 */
816function isRelativeSpecifier(specifier) {
817 if (specifier[0] === '.') {
818 if (specifier.length === 1 || specifier[1] === '/') { return true; }
819 if (specifier[1] === '.') {
820 if (specifier.length === 2 || specifier[2] === '/') { return true; }
821 }
822 }
823 return false;
824}
825
826/**
827 * Determines whether a specifier should be treated as a relative or absolute path.

Callers 2

resolveAsCommonJSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…