mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
esm: fix typo parentUrl -> parentURL
PR-URL: https://github.com/nodejs/node/pull/48999 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit is contained in:
1 parent
9641ac6c65
commit
74a2e1e0ab
2 files changed
+8
-8
No files matched your search
@@ -5,16 +5,16 @@ const experimentalImportMetaResolve = getOptionValue('--experimental-import-meta
|
||||
|
||||
/**
|
||||
* Generate a function to be used as import.meta.resolve for a particular module.
|
||||
* @param {string} defaultParentUrl The default base to use for resolution
|
||||
* @param {string} defaultParentURL The default base to use for resolution
|
||||
* @param {typeof import('./loader.js').ModuleLoader} loader Reference to the current module loader
|
||||
* @returns {(specifier: string, parentUrl?: string) => string} Function to assign to import.meta.resolve
|
||||
* @returns {(specifier: string, parentURL?: string) => string} Function to assign to import.meta.resolve
|
||||
*/
|
||||
function createImportMetaResolve(defaultParentUrl, loader) {
|
||||
return function resolve(specifier, parentUrl = defaultParentUrl) {
|
||||
function createImportMetaResolve(defaultParentURL, loader) {
|
||||
return function resolve(specifier, parentURL = defaultParentURL) {
|
||||
let url;
|
||||
|
||||
try {
|
||||
({ url } = loader.resolveSync(specifier, parentUrl));
|
||||
({ url } = loader.resolveSync(specifier, parentURL));
|
||||
} catch (error) {
|
||||
if (error?.code === 'ERR_UNSUPPORTED_DIR_IMPORT') {
|
||||
({ url } = error);
|
||||
|
||||
@@ -152,7 +152,7 @@ class ModuleLoader {
|
||||
* string, parentURL: string,
|
||||
* importAssertions: Record<string, string>
|
||||
* ) ResolveResult;
|
||||
* register(specifier: string, parentUrl: string): any;
|
||||
* register(specifier: string, parentURL: string): any;
|
||||
* forceLoadHooks(): void;
|
||||
* }
|
||||
* ```
|
||||
@@ -307,7 +307,7 @@ class ModuleLoader {
|
||||
return module.getNamespace();
|
||||
}
|
||||
|
||||
register(specifier, parentUrl) {
|
||||
register(specifier, parentURL) {
|
||||
if (!this.#customizations) {
|
||||
// `CustomizedModuleLoader` is defined at the bottom of this file and
|
||||
// available well before this line is ever invoked. This is here in
|
||||
@@ -315,7 +315,7 @@ class ModuleLoader {
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
this.setCustomizations(new CustomizedModuleLoader());
|
||||
}
|
||||
return this.#customizations.register(specifier, parentUrl);
|
||||
return this.#customizations.register(specifier, parentURL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user