* Either return a cached resolution, or perform the default resolution which is synchronous, and * cache the result. * @param {string} specifier See resolve. * @param {{ parentURL?: string, importAttributes: ImportAttributes, conditions?: string[]}} context * @returns {{ format:
(specifier, context)
| 694 | * @returns {{ format: string, url: string }} |
| 695 | */ |
| 696 | #cachedDefaultResolve(specifier, context) { |
| 697 | const { parentURL, importAttributes } = context; |
| 698 | const requestKey = this.#resolveCache.serializeKey(specifier, importAttributes); |
| 699 | const cachedResult = this.#resolveCache.get(requestKey, parentURL); |
| 700 | if (cachedResult != null) { |
| 701 | return cachedResult; |
| 702 | } |
| 703 | |
| 704 | const result = defaultResolve(specifier, context); |
| 705 | this.#resolveCache.set(requestKey, parentURL, result); |
| 706 | return result; |
| 707 | } |
| 708 | |
| 709 | /** |
| 710 | * This is the default resolve step for module.registerHooks(), which incorporates asynchronous hooks |
no test coverage detected