GeezerVison is showing github.com — doc: fix myUrl is not defined in url · nodejs/node@b37d53a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/url.md +5-5Lines changed: 5 additions & 5 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -554,14 +554,14 @@ instance, the `URL` object will not percent encode the ASCII tilde (`~`) |
554 | 554 | character, while `URLSearchParams` will always encode it: |
555 | 555 |
|
556 | 556 | ```js |
557 | | -const myUrl = new URL('https://example.org/abc?foo=~bar'); |
| 557 | +const myURL = new URL('https://example.org/abc?foo=~bar'); |
558 | 558 |
|
559 | | -console.log(myUrl.search); // prints ?foo=~bar |
| 559 | +console.log(myURL.search); // prints ?foo=~bar |
560 | 560 |
|
561 | 561 | // Modify the URL via searchParams... |
562 | | -myUrl.searchParams.sort(); |
| 562 | +myURL.searchParams.sort(); |
563 | 563 |
|
564 | | -console.log(myUrl.search); // prints ?foo=%7Ebar |
| 564 | +console.log(myURL.search); // prints ?foo=%7Ebar |
565 | 565 | ``` |
566 | 566 |
|
567 | 567 | #### `url.username` |
@@ -1271,7 +1271,7 @@ console.log(urlToHttpOptions(myURL)); |
1271 | 1271 | const { urlToHttpOptions } = require('node:url'); |
1272 | 1272 | const myURL = new URL('https://a:b@測試?abc#foo'); |
1273 | 1273 |
|
1274 | | -console.log(urlToHttpOptions(myUrl)); |
| 1274 | +console.log(urlToHttpOptions(myURL)); |
1275 | 1275 | /* |
1276 | 1276 | { |
1277 | 1277 | protocol: 'https:', |
|