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

Function resolveWithHooks

lib/internal/modules/customization_hooks.js:408–418  ·  view source on GitHub ↗

* Resolve module request to a url, through a hooks chain if it exists. * @param {string} specifier * @param {string|undefined} parentURL * @param {ImportAttributes|undefined} importAttributes * @param {string[]} conditions * @param {(specifier: string, context: ModuleResolveContext) => ModuleRe

(specifier, parentURL, importAttributes, conditions, defaultResolve)

Source from the content-addressed store, hash-verified

406 * @returns {ModuleResolveResult}
407 */
408function resolveWithHooks(specifier, parentURL, importAttributes, conditions, defaultResolve) {
409 debug('resolveWithHooks', specifier, parentURL, importAttributes);
410 const context = new ModuleResolveContext(parentURL, importAttributes, conditions);
411 if (resolveHooks.length === 0) {
412 return defaultResolve(specifier, context);
413 }
414
415 const runner = buildHooks(resolveHooks, 'resolve', defaultResolve, validateResolve, context);
416
417 return runner(specifier, context);
418}
419
420module.exports = {
421 convertCJSFilenameToURL,

Callers 1

resolveForCJSWithHooksFunction · 0.85

Calls 4

buildHooksFunction · 0.85
debugFunction · 0.50
defaultResolveFunction · 0.50
runnerFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…