Skip to content

Commit a793cf4

Browse files
aduh95targos
authored andcommitted
esm: rename URLCanParse to be consistent
PR-URL: #47668 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c0c23fb commit a793cf4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎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
thrownewERR_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
thrownewERR_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
@@ -38,7 +38,7 @@ const experimentalNetworkImports =
3838
getOptionValue('--experimental-network-imports');
3939
consttypeFlag=getOptionValue('--input-type');
4040
const{URL, pathToFileURL, fileURLToPath, isURL, toPathIfFileURL }=require('internal/url');
41-
const{canParse: canParseURL}=internalBinding('url');
41+
const{canParse: URLCanParse}=internalBinding('url');
4242
const{
4343
ERR_INPUT_TYPE_NOT_ALLOWED,
4444
ERR_INVALID_ARG_TYPE,
@@ -328,7 +328,7 @@ function resolvePackageTargetString(
328328
if(internal&&!StringPrototypeStartsWith(target,'../')&&
329329
!StringPrototypeStartsWith(target,'/')){
330330
// No need to convert target to string, since it's already presumed to be
331-
if(!canParseURL(target)){
331+
if(!URLCanParse(target)){
332332
constexportTarget=pattern ?
333333
RegExpPrototypeSymbolReplace(patternRegEx,target,()=>subpath) :
334334
target+subpath;

0 commit comments

Comments
 (0)