@@ -129,6 +129,13 @@ return `true`.
129
129
130
130
#### ` new URL(input[, base]) `
131
131
132
+ <!--
133
+ changes:
134
+ - version: REPLACEME
135
+ pr-url: https://github.com/nodejs/node/pull/47339
136
+ description: ICU requirement is removed.
137
+ -->
138
+
132
139
* ` input ` {string} The absolute or relative input URL to parse. If ` input `
133
140
is relative, then ` base ` is required. If ` input ` is absolute, the ` base `
134
141
is ignored. If ` input ` is not a string, it is [ converted to a string] [ ] first.
@@ -172,9 +179,6 @@ const myURL = new URL('https://測試');
172
179
// https://xn--g6w251d/
173
180
```
174
181
175
- This feature is only available if the ` node ` executable was compiled with
176
- [ ICU] [ ] enabled. If not, the domain names are passed through unchanged.
177
-
178
182
In cases where it is not known in advance if ` input ` is an absolute URL
179
183
and a ` base ` is provided, it is advised to validate that the ` origin ` of
180
184
the ` URL ` object is what is expected.
@@ -1029,6 +1033,10 @@ for (const [name, value] of params) {
1029
1033
added:
1030
1034
- v7.4.0
1031
1035
- v6.13.0
1036
+ changes:
1037
+ - version: REPLACEME
1038
+ pr-url: https://github.com/nodejs/node/pull/47339
1039
+ description: ICU requirement is removed.
1032
1040
-->
1033
1041
1034
1042
* ` domain ` {string}
@@ -1039,9 +1047,6 @@ invalid domain, the empty string is returned.
1039
1047
1040
1048
It performs the inverse operation to [ ` url.domainToUnicode() ` ] [ ] .
1041
1049
1042
- This feature is only available if the ` node ` executable was compiled with
1043
- [ ICU] [ ] enabled. If not, the domain names are passed through unchanged.
1044
-
1045
1050
``` mjs
1046
1051
import url from ' node:url' ;
1047
1052
@@ -1070,6 +1075,10 @@ console.log(url.domainToASCII('xn--iñvalid.com'));
1070
1075
added:
1071
1076
- v7.4.0
1072
1077
- v6.13.0
1078
+ changes:
1079
+ - version: REPLACEME
1080
+ pr-url: https://github.com/nodejs/node/pull/47339
1081
+ description: ICU requirement is removed.
1073
1082
-->
1074
1083
1075
1084
* ` domain ` {string}
@@ -1080,9 +1089,6 @@ domain, the empty string is returned.
1080
1089
1081
1090
It performs the inverse operation to [ ` url.domainToASCII() ` ] [ ] .
1082
1091
1083
- This feature is only available if the ` node ` executable was compiled with
1084
- [ ICU] [ ] enabled. If not, the domain names are passed through unchanged.
1085
-
1086
1092
``` mjs
1087
1093
import url from ' node:url' ;
1088
1094
@@ -1727,7 +1733,6 @@ console.log(myURL.origin);
1727
1733
// Prints https://xn--1xa.example.com
1728
1734
` ` `
1729
1735
1730
- [ICU]: intl.md#options-for-building-nodejs
1731
1736
[Punycode]: https://tools.ietf.org/html/rfc5891#section-4.4
1732
1737
[WHATWG URL]: #the-whatwg-url-api
1733
1738
[WHATWG URL Standard]: https://url.spec.whatwg.org/
0 commit comments