Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1bd286e

Browse filesBrowse files
Trottdanielleadams
authored andcommitted
doc: revise url.resolve() text
PR-URL: #41661 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 59f95fe commit 1bd286e
Copy full SHA for 1bd286e

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/url.md‎

Copy file name to clipboardExpand all lines: doc/api/url.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1568,11 +1568,11 @@ changes:
15681568

15691569
> Stability: 3 - Legacy: Use the WHATWG URL API instead.
15701570

1571-
* `from` {string} The Base URL being resolved against.
1572-
* `to` {string} The HREF URL being resolved.
1571+
* `from` {string} The base URL to use if `to` is a relative URL.
1572+
* `to` {string} The target URL to resolve.
15731573

15741574
The `url.resolve()` method resolves a target URL relative to a base URL in a
1575-
manner similar to that of a Web browser resolving an anchor tag HREF.
1575+
manner similar to that of a web browser resolving an anchor tag.
15761576

15771577
```js
15781578
const url = require('url');
@@ -1581,7 +1581,7 @@ url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
15811581
url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
15821582
```
15831583

1584-
You can achieve the same result using the WHATWG URL API:
1584+
To achieve the same result using the WHATWG URL API:
15851585

15861586
```js
15871587
function resolve(from, to) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.