-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
url: add value argument to has and delete methods #47885
Changes from 12 commits
7d99ffc
ecf95b5
5031f58
f1845e3
2846704
a0522c8
3c1521f
e66fe1e
68624b3
29c316c
9126a64
3b19423
fb0e57d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -859,11 +859,22 @@ new URLSearchParams([ | |||||
|
||||||
Append a new name-value pair to the query string. | ||||||
|
||||||
#### `urlSearchParams.delete(name)` | ||||||
#### `urlSearchParams.delete(name[, value])` | ||||||
|
||||||
<!-- YAML | ||||||
changes: | ||||||
- version: REPLACEME | ||||||
pr-url: https://github.com/nodejs/node/pull/47885 | ||||||
description: added optional value argument. | ||||||
--> | ||||||
|
||||||
anonrig marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
* `name` {string} | ||||||
* `value` {string} | ||||||
|
||||||
If `value` is provided, then delete all name-value pairs with | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The phrasing should be consistent between the two paragraphs.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks |
||||||
whose `name` is name and `value` is value. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Remove all name-value pairs whose name is `name`. | ||||||
If `value` is not provided, remove all name-value pairs whose name is `name`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
#### `urlSearchParams.entries()` | ||||||
|
||||||
|
@@ -918,12 +929,27 @@ are no such pairs, `null` is returned. | |||||
Returns the values of all name-value pairs whose name is `name`. If there are | ||||||
no such pairs, an empty array is returned. | ||||||
|
||||||
#### `urlSearchParams.has(name)` | ||||||
#### `urlSearchParams.has(name[, value])` | ||||||
|
||||||
<!-- YAML | ||||||
changes: | ||||||
- version: REPLACEME | ||||||
pr-url: https://github.com/nodejs/node/pull/47885 | ||||||
description: added optional value argument. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
--> | ||||||
|
||||||
* `name` {string} | ||||||
* `value` {string} | ||||||
* Returns: {boolean} | ||||||
|
||||||
Returns `true` if there is at least one name-value pair whose name is `name`. | ||||||
Checks if the `URLSearchParams` object contains key-value pair(s) based on | ||||||
`name` and an optional `value` argument. | ||||||
|
||||||
If `value` is provided, returns `true` when name-value pair with | ||||||
same `name` and `value` exists. | ||||||
|
||||||
If `value` is not provided, returns `true` if there is at least one name-value | ||||||
pair whose name is `name`. | ||||||
|
||||||
#### `urlSearchParams.keys()` | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.