diff options
author | Youngmin Yoo <recrack@gmail.com> | 2023-03-08 16:34:55 +0900 |
---|---|---|
committer | Danielle Adams <adamzdanielle@gmail.com> | 2023-04-10 20:55:11 -0400 |
commit | b37d53a1baec52c2cf0188f7c2637ecdfda57390 (patch) | |
tree | f1c31fcd62b14cd95cdb02f8daa761c7cc5e02fc | |
parent | 80b4e6da53e44d10afee9921312595a6a07a174e (diff) | |
download | node-new-b37d53a1baec52c2cf0188f7c2637ecdfda57390.tar.gz |
doc: fix myUrl is not defined in url
Fixes a typo in the variable name in the URL code example in doc.
Renames `myUrl` to `myURL` for consistency and readability.
PR-URL: https://github.com/nodejs/node/pull/46968
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Deokjin Kim <deokjin81.kim@gmail.com>
-rw-r--r-- | doc/api/url.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/api/url.md b/doc/api/url.md index 73f33dc842..adf97e1513 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -554,14 +554,14 @@ instance, the `URL` object will not percent encode the ASCII tilde (`~`) character, while `URLSearchParams` will always encode it: ```js -const myUrl = new URL('https://example.org/abc?foo=~bar'); +const myURL = new URL('https://example.org/abc?foo=~bar'); -console.log(myUrl.search); // prints ?foo=~bar +console.log(myURL.search); // prints ?foo=~bar // Modify the URL via searchParams... -myUrl.searchParams.sort(); +myURL.searchParams.sort(); -console.log(myUrl.search); // prints ?foo=%7Ebar +console.log(myURL.search); // prints ?foo=%7Ebar ``` #### `url.username` @@ -1271,7 +1271,7 @@ console.log(urlToHttpOptions(myURL)); const { urlToHttpOptions } = require('node:url'); const myURL = new URL('https://a:b@測試?abc#foo'); -console.log(urlToHttpOptions(myUrl)); +console.log(urlToHttpOptions(myURL)); /* { protocol: 'https:', |