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

(v6.x-staging) doc: remove leftover WHATWG url.format section #14351

Closed
wants to merge 1 commit into from
Closed
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
41 changes: 0 additions & 41 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,47 +198,6 @@ The formatting process operates as follows:
string, an [`Error`][] is thrown.
* `result` is returned.

## url.format(URL[, options])

> Stability: 1 - Experimental

* `URL` {URL} A [WHATWG URL][] object
* `options` {Object}
* `auth` {boolean} `true` if the serialized URL string should include the
username and password, `false` otherwise. Defaults to `true`.
* `fragment` {boolean} `true` if the serialized URL string should include the
fragment, `false` otherwise. Defaults to `true`.
* `search` {boolean} `true` if the serialized URL string should include the
search query, `false` otherwise. Defaults to `true`.
* `unicode` {boolean} `true` if Unicode characters appearing in the host
component of the URL string should be encoded directly as opposed to being
Punycode encoded. Defaults to `false`.

Returns a customizable serialization of a URL String representation of a
[WHATWG URL][] object.

The URL object has both a `toString()` method and `href` property that return
string serializations of the URL. These are not, however, customizable in
any way. The `url.format(URL[, options])` method allows for basic customization
of the output.

For example:

```js
const myURL = new URL('https://a:b@你好你好?abc#foo');

console.log(myURL.href);
// Prints https://a:b@xn--6qqa088eba/?abc#foo

console.log(myURL.toString());
// Prints https://a:b@xn--6qqa088eba/?abc#foo

console.log(url.format(myURL, {fragment: false, unicode: true, auth: false}));
// Prints 'https://你好你好?abc'
```

*Note*: This variation of the `url.format()` method is currently considered to
be experimental.

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