From b6a1aba6b5779502af86459634290d458f9fe9dc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 24 Jan 2022 19:43:55 -0800 Subject: [PATCH] doc: revise url.resolve() text PR-URL: https://github.com/nodejs/node/pull/41661 Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Benjamin Gruenbaum Reviewed-By: Mestery Reviewed-By: Darshan Sen Reviewed-By: Luigi Pinca --- doc/api/url.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/url.md b/doc/api/url.md index e5865a5d313d1e..0dc4620c41d5fc 100644 --- a/doc/api/url.md +++ b/doc/api/url.md @@ -1568,11 +1568,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'); @@ -1581,7 +1581,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) {