Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: revise url.resolve() text #41661

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -1585,11 +1585,11 @@ changes:

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

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

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

```js
const url = require('url');
Expand All @@ -1598,7 +1598,7 @@ url.resolve('http://example.com/', '/one'); // 'http://example.com/one'
url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'
```

You can achieve the same result using the WHATWG URL API:
To achieve the same result using the WHATWG URL API:

```js
function resolve(from, to) {
Expand Down