Skip to content

Commit 9790499

Browse files
committed
esm: rename URLCanParse to be consistent
1 parent 595b2b3 commit 9790499

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/internal/modules/esm/hooks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const {
3434
} = require('internal/errors').codes;
3535
const { exitCodes: { kUnfinishedTopLevelAwait } } = internalBinding('errors');
3636
const { URL } = require('internal/url');
37-
const { canParse: urlCanParse } = internalBinding('url');
37+
const { canParse: URLCanParse } = internalBinding('url');
3838
const { receiveMessageOnPort } = require('worker_threads');
3939
const {
4040
isAnyArrayBuffer,
@@ -274,7 +274,7 @@ class Hooks {
274274
// Avoid expensive URL instantiation for known-good URLs
275275
if (!this.#validatedUrls.has(url)) {
276276
// No need to convert to string, since the type is already validated
277-
if (!urlCanParse(url)) {
277+
if (!URLCanParse(url)) {
278278
throw new ERR_INVALID_RETURN_PROPERTY_VALUE(
279279
'a URL string',
280280
hookErrIdentifier,
@@ -354,7 +354,7 @@ class Hooks {
354354
// Avoid expensive URL instantiation for known-good URLs
355355
if (!this.#validatedUrls.has(nextUrl)) {
356356
// No need to convert to string, since the type is already validated
357-
if (!urlCanParse(nextUrl)) {
357+
if (!URLCanParse(nextUrl)) {
358358
throw new ERR_INVALID_ARG_VALUE(
359359
`${hookErrIdentifier} url`,
360360
nextUrl,

lib/internal/modules/esm/resolve.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const experimentalNetworkImports =
4242
getOptionValue('--experimental-network-imports');
4343
const typeFlag = getOptionValue('--input-type');
4444
const { URL, pathToFileURL, fileURLToPath, isURL } = require('internal/url');
45-
const { canParse: canParseURL } = internalBinding('url');
45+
const { canParse: URLCanParse } = internalBinding('url');
4646
const {
4747
ERR_INPUT_TYPE_NOT_ALLOWED,
4848
ERR_INVALID_ARG_TYPE,
@@ -335,7 +335,7 @@ function resolvePackageTargetString(
335335
if (internal && !StringPrototypeStartsWith(target, '../') &&
336336
!StringPrototypeStartsWith(target, '/')) {
337337
// No need to convert target to string, since it's already presumed to be
338-
if (!canParseURL(target)) {
338+
if (!URLCanParse(target)) {
339339
const exportTarget = pattern ?
340340
RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) :
341341
target + subpath;

0 commit comments

Comments
 (0)