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

Function packageMapResolve

lib/internal/modules/package_map.js:300–304  ·  view source on GitHub ↗

* Resolve a package specifier using the package map. * Returns the package path and subpath, or undefined if resolution should * fall back to standard resolution. * @param {string} specifier - The bare specifier (e.g., "lodash", "react/jsx-runtime") * @param {string} parentPath - File path of th

(specifier, parentPath)

Source from the content-addressed store, hash-verified

298 * @returns {{packagePath: string, subpath: string}|undefined}
299 */
300function packageMapResolve(specifier, parentPath) {
301 const map = getPackageMap();
302 assert(map !== null, 'Package map is not enabled');
303 return map.resolve(specifier, parentPath);
304}
305
306module.exports = {
307 hasPackageMap,

Callers 2

packageResolveFunction · 0.85
tryPackageMapResolveCJSFunction · 0.85

Calls 3

getPackageMapFunction · 0.85
assertFunction · 0.50
resolveMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…