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: fix history info for URLSearchParams #55840

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
75 changes: 75 additions & 0 deletions doc/api/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,22 @@ console.log(myURL.href);

#### `new URLSearchParams()`

<!-- YAML
added:
- v7.5.0
- v6.13.0
-->

Instantiate a new empty `URLSearchParams` object.

#### `new URLSearchParams(string)`

<!-- YAML
added:
- v7.5.0
- v6.13.0
-->

* `string` {string} A query string

Parse the `string` as a query string, and use it to instantiate a new
Expand Down Expand Up @@ -881,6 +893,12 @@ new URLSearchParams([

#### `urlSearchParams.append(name, value)`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* `name` {string}
* `value` {string}

Expand All @@ -889,6 +907,9 @@ Append a new name-value pair to the query string.
#### `urlSearchParams.delete(name[, value])`

<!-- YAML
added:
- v7.0.0
- v6.13.0
changes:
- version:
- v20.2.0
Expand All @@ -907,6 +928,12 @@ If `value` is not provided, removes all name-value pairs whose name is `name`.

#### `urlSearchParams.entries()`

<!-- YAML
added:
- v7.3.0
- v6.13.0
-->

* Returns: {Iterator}

Returns an ES6 `Iterator` over each of the name-value pairs in the query.
Expand All @@ -918,6 +945,9 @@ Alias for [`urlSearchParams[@@iterator]()`][`urlSearchParams@@iterator()`].
#### `urlSearchParams.forEach(fn[, thisArg])`

<!-- YAML
added:
- v7.3.0
- v6.13.0
changes:
- version: v18.0.0
pr-url: https://github.com/nodejs/node/pull/41678
Expand All @@ -943,6 +973,12 @@ myURL.searchParams.forEach((value, name, searchParams) => {

#### `urlSearchParams.get(name)`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* `name` {string}
* Returns: {string | null} A string or `null` if there is no name-value pair
with the given `name`.
Expand All @@ -952,6 +988,12 @@ are no such pairs, `null` is returned.

#### `urlSearchParams.getAll(name)`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* `name` {string}
* Returns: {string\[]}

Expand All @@ -961,6 +1003,9 @@ no such pairs, an empty array is returned.
#### `urlSearchParams.has(name[, value])`

<!-- YAML
added:
- v7.0.0
- v6.13.0
changes:
- version:
- v20.2.0
Expand All @@ -984,6 +1029,12 @@ pair whose name is `name`.

#### `urlSearchParams.keys()`

<!-- YAML
added:
- v7.3.0
- v6.13.0
-->

* Returns: {Iterator}

Returns an ES6 `Iterator` over the names of each name-value pair.
Expand All @@ -1000,6 +1051,12 @@ for (const name of params.keys()) {

#### `urlSearchParams.set(name, value)`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* `name` {string}
* `value` {string}

Expand Down Expand Up @@ -1055,19 +1112,37 @@ console.log(params.toString());

#### `urlSearchParams.toString()`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* Returns: {string}

Returns the search parameters serialized as a string, with characters
percent-encoded where necessary.

#### `urlSearchParams.values()`

<!-- YAML
added:
- v7.3.0
- v6.13.0
-->

* Returns: {Iterator}

Returns an ES6 `Iterator` over the values of each name-value pair.

#### `urlSearchParams[Symbol.iterator]()`

<!-- YAML
added:
- v7.0.0
- v6.13.0
-->

* Returns: {Iterator}

Returns an ES6 `Iterator` over each of the name-value pairs in the query string.
Expand Down
Loading