File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed 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 (`~`)
554554character, while ` URLSearchParams ` will always encode it:
555555
556556``` js
557- const myUrl = new URL (' https://example.org/abc?foo=~bar' );
557+ const myURL = new URL (' https://example.org/abc?foo=~bar' );
558558
559- console .log (myUrl .search ); // prints ?foo=~bar
559+ console .log (myURL .search ); // prints ?foo=~bar
560560
561561// Modify the URL via searchParams...
562- myUrl .searchParams .sort ();
562+ myURL .searchParams .sort ();
563563
564- console .log (myUrl .search ); // prints ?foo=%7Ebar
564+ console .log (myURL .search ); // prints ?foo=%7Ebar
565565```
566566
567567#### ` url.username `
@@ -1271,7 +1271,7 @@ console.log(urlToHttpOptions(myURL));
12711271const { urlToHttpOptions } = require (' node:url' );
12721272const myURL = new URL (' https://a:b@測試?abc#foo' );
12731273
1274- console .log (urlToHttpOptions (myUrl ));
1274+ console .log (urlToHttpOptions (myURL ));
12751275/*
12761276{
12771277 protocol: 'https:',
You can’t perform that action at this time.
0 commit comments