Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a793cf4

Browse filesBrowse 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
Copy full SHA for a793cf4

File tree

Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎lib/internal/modules/esm/hooks.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/hooks.js
+3-3Lines 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,
Collapse file

‎lib/internal/modules/esm/resolve.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/resolve.js
+2-2Lines 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
const typeFlag = 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
const exportTarget = pattern ?
333333
RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) :
334334
target + subpath;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.