Skip to content

Commit 0b79ed3

Browse files
committed
Cleanup
1 parent 39c8cf8 commit 0b79ed3

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

lib/internal/modules/esm/hooks.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ class Hooks {
9898

9999
/**
100100
* Collect custom/user-defined module loader hook(s).
101-
* @param {import('./loader.js).KeyedExports} customLoaders Exports from user-defined loaders (as returned by `ESMLoader.import()`).
102-
*/
101+
* @param {import('./loader.js).KeyedExports} customLoaders Exports from user-defined loaders
102+
* (as returned by `ESMLoader.import()`).
103+
*/
103104
#addCustomLoaders(
104105
customLoaders = [],
105106
) {

lib/internal/modules/esm/loader.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const {
1616
const {
1717
ERR_UNKNOWN_MODULE_FORMAT,
1818
} = require('internal/errors').codes;
19-
const { pathToFileURL, URL } = require('internal/url');
19+
const { pathToFileURL } = require('internal/url');
2020
const { emitExperimentalWarning } = require('internal/util');
2121

2222
function newModuleMap() {
@@ -294,20 +294,20 @@ class ESMLoader {
294294
) {
295295
if (this.#hooks) {
296296
return this.#hooks.resolve(originalSpecifier, parentURL, importAssertions);
297-
} else {
298-
if (!this.#defaultResolve || !this.#defaultConditions) {
299-
const { defaultResolve, DEFAULT_CONDITIONS } = require('internal/modules/esm/resolve');
300-
this.#defaultResolve = defaultResolve;
301-
this.#defaultConditions = DEFAULT_CONDITIONS;
302-
}
303-
const context = {
304-
__proto__: null,
305-
conditions: this.#defaultConditions,
306-
importAssertions,
307-
parentURL,
308-
};
309-
return this.#defaultResolve(originalSpecifier, context);
310297
}
298+
if (!this.#defaultResolve || !this.#defaultConditions) {
299+
const { defaultResolve, DEFAULT_CONDITIONS } = require('internal/modules/esm/resolve');
300+
this.#defaultResolve = defaultResolve;
301+
this.#defaultConditions = DEFAULT_CONDITIONS;
302+
}
303+
const context = {
304+
__proto__: null,
305+
conditions: this.#defaultConditions,
306+
importAssertions,
307+
parentURL,
308+
};
309+
return this.#defaultResolve(originalSpecifier, context);
310+
311311
}
312312

313313
/**

0 commit comments

Comments
 (0)