* 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)
| 406 | * @returns {ModuleResolveResult} |
| 407 | */ |
| 408 | function 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 | |
| 420 | module.exports = { |
| 421 | convertCJSFilenameToURL, |
no test coverage detected
searching dependent graphs…