Skip to content

Commit a35c6c3

Browse files
Trottruyadorno
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 986dbb3 commit a35c6c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/api/url.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1585,11 +1585,11 @@ changes:
15851585

15861586
> Stability: 3 - Legacy: Use the WHATWG URL API instead.
15871587

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

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

15941594
```js
15951595
const url = require('url');
@@ -1598,7 +1598,7 @@ url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
15981598
url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
15991599
```
16001600

1601-
You can achieve the same result using the WHATWG URL API:
1601+
To achieve the same result using the WHATWG URL API:
16021602

16031603
```js
16041604
function resolve(from, to) {

0 commit comments

Comments
 (0)