Skip to content

Commit fcb27fa

Browse files
silverwindMylesBorins
authored andcommitted
doc: remove leftover WHATWG url.format section
The backport in #13054 contained a leftover section from the WHATWG url.format, in addition to the existing url.format. This removes this section. PR-URL: #14351 Reviewed-By: Myles Borins <[email protected]>
1 parent e400ef9 commit fcb27fa

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

doc/api/url.md

-41
Original file line numberDiff line numberDiff line change
@@ -198,47 +198,6 @@ The formatting process operates as follows:
198198
string, an [`Error`][] is thrown.
199199
* `result` is returned.
200200

201-
## url.format(URL[, options])
202-
203-
> Stability: 1 - Experimental
204-
205-
* `URL` {URL} A [WHATWG URL][] object
206-
* `options` {Object}
207-
* `auth` {boolean} `true` if the serialized URL string should include the
208-
username and password, `false` otherwise. Defaults to `true`.
209-
* `fragment` {boolean} `true` if the serialized URL string should include the
210-
fragment, `false` otherwise. Defaults to `true`.
211-
* `search` {boolean} `true` if the serialized URL string should include the
212-
search query, `false` otherwise. Defaults to `true`.
213-
* `unicode` {boolean} `true` if Unicode characters appearing in the host
214-
component of the URL string should be encoded directly as opposed to being
215-
Punycode encoded. Defaults to `false`.
216-
217-
Returns a customizable serialization of a URL String representation of a
218-
[WHATWG URL][] object.
219-
220-
The URL object has both a `toString()` method and `href` property that return
221-
string serializations of the URL. These are not, however, customizable in
222-
any way. The `url.format(URL[, options])` method allows for basic customization
223-
of the output.
224-
225-
For example:
226-
227-
```js
228-
const myURL = new URL('https://a:b@你好你好?abc#foo');
229-
230-
console.log(myURL.href);
231-
// Prints https://a:b@xn--6qqa088eba/?abc#foo
232-
233-
console.log(myURL.toString());
234-
// Prints https://a:b@xn--6qqa088eba/?abc#foo
235-
236-
console.log(url.format(myURL, {fragment: false, unicode: true, auth: false}));
237-
// Prints 'https://你好你好?abc'
238-
```
239-
240-
*Note*: This variation of the `url.format()` method is currently considered to
241-
be experimental.
242201

243202
## url.parse(urlString[, parseQueryString[, slashesDenoteHost]])
244203
<!-- YAML

0 commit comments

Comments
 (0)