mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
esm: rename URLCanParse to be consistent
PR-URL: https://github.com/nodejs/node/pull/47668 Backport-PR-URL: https://github.com/nodejs/node/pull/50669 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>
This commit is contained in:
1 parent
b77a6b2376
commit
b61efcce95
2 files changed
+6
-6
No files matched your search
@@ -33,7 +33,7 @@ const {
|
||||
ERR_WORKER_UNSERIALIZABLE_ERROR,
|
||||
} = require('internal/errors').codes;
|
||||
const { URL } = require('internal/url');
|
||||
const { canParse: urlCanParse } = internalBinding('url');
|
||||
const { canParse: URLCanParse } = internalBinding('url');
|
||||
const { receiveMessageOnPort } = require('worker_threads');
|
||||
const {
|
||||
isAnyArrayBuffer,
|
||||
@@ -272,7 +272,7 @@ class Hooks {
|
||||
// Avoid expensive URL instantiation for known-good URLs
|
||||
if (!this.#validatedUrls.has(url)) {
|
||||
// No need to convert to string, since the type is already validated
|
||||
if (!urlCanParse(url)) {
|
||||
if (!URLCanParse(url)) {
|
||||
throw new ERR_INVALID_RETURN_PROPERTY_VALUE(
|
||||
'a URL string',
|
||||
hookErrIdentifier,
|
||||
@@ -351,7 +351,7 @@ class Hooks {
|
||||
// Avoid expensive URL instantiation for known-good URLs
|
||||
if (!this.#validatedUrls.has(nextUrl)) {
|
||||
// No need to convert to string, since the type is already validated
|
||||
if (!urlCanParse(nextUrl)) {
|
||||
if (!URLCanParse(nextUrl)) {
|
||||
throw new ERR_INVALID_ARG_VALUE(
|
||||
`${hookErrIdentifier} url`,
|
||||
nextUrl,
|
||||
|
||||
@@ -38,8 +38,8 @@ const preserveSymlinksMain = getOptionValue('--preserve-symlinks-main');
|
||||
const experimentalNetworkImports =
|
||||
getOptionValue('--experimental-network-imports');
|
||||
const typeFlag = getOptionValue('--input-type');
|
||||
const { URL, pathToFileURL, fileURLToPath, toPathIfFileURL, isURL } = require('internal/url');
|
||||
const { canParse: canParseURL } = internalBinding('url');
|
||||
const { URL, pathToFileURL, fileURLToPath, isURL, toPathIfFileURL } = require('internal/url');
|
||||
const { canParse: URLCanParse } = internalBinding('url');
|
||||
const {
|
||||
ERR_INPUT_TYPE_NOT_ALLOWED,
|
||||
ERR_INVALID_ARG_TYPE,
|
||||
@@ -395,7 +395,7 @@ function resolvePackageTargetString(
|
||||
if (internal && !StringPrototypeStartsWith(target, '../') &&
|
||||
!StringPrototypeStartsWith(target, '/')) {
|
||||
// No need to convert target to string, since it's already presumed to be
|
||||
if (!canParseURL(target)) {
|
||||
if (!URLCanParse(target)) {
|
||||
const exportTarget = pattern ?
|
||||
RegExpPrototypeSymbolReplace(patternRegEx, target, () => subpath) :
|
||||
target + subpath;
|
||||
|
||||
Reference in new issue
Block a user