From 67e20f53cd136c75ccb8bd56598cc5844d0bf439 Mon Sep 17 00:00:00 2001 From: Youngmin Yoo Date: Wed, 8 Mar 2023 16:34:55 +0900 Subject: [PATCH] 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 Reviewed-By: Harshitha K P Reviewed-By: Yagiz Nizipli Reviewed-By: Akhil Marsonya Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Deokjin Kim --- doc/api/url.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/api/url.md b/doc/api/url.md index a10b5947c40eda..7d5a19b8784dc0 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:',