MCPcopy Index your code
hub / github.com/nodejs/node / #resolve

Method #resolve

lib/internal/modules/esm/loader.js:678–687  ·  view source on GitHub ↗

* Resolve a module request to a URL identifying the location of the module. Handles customization hooks, * if any. * @param {string} [parentURL] The URL of the module where the module request is initiated. * It's undefined if it's from the root module. * @param {ModuleRequest} request

(parentURL, request)

Source from the content-addressed store, hash-verified

676 * @returns {Promise<ResolveResult>|ResolveResult}
677 */
678 #resolve(parentURL, request) {
679 if (this.isForAsyncLoaderHookWorker) {
680 const specifier = `${request.specifier}`;
681 const importAttributes = request.attributes ?? kEmptyObject;
682 // TODO(joyeecheung): invoke the synchronous hooks in the default step on loader thread.
683 return this.#asyncLoaderHooks.resolve(specifier, parentURL, importAttributes);
684 }
685
686 return this.resolveSync(parentURL, request);
687 }
688
689 /**
690 * Either return a cached resolution, or perform the default resolution which is synchronous, and

Callers 1

getOrCreateModuleJobMethod · 0.95

Calls 2

resolveSyncMethod · 0.95
resolveMethod · 0.45

Tested by

no test coverage detected