mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 08:06:22 +08:00
node: add the 3rd parameter to URLSearchParams.forEach (#27732)
The documentation for [URLSearchParams.forEach][1] shows that the callback function will be called with 3 parameters. This has been true since Node 6. This commit adds a definition for the 3rd parameter to the definition files for Node 6, 7, 8, 9 and 10. [1]: https://nodejs.org/api/url.html#url_urlsearchparams_foreach_fn_thisarg
This commit is contained in:
committed by
Sheetal Nandi
parent
9a41d9b636
commit
e425a450ce
@@ -690,9 +690,10 @@ namespace url_tests {
|
||||
const searchParams = new url.URLSearchParams('abc=123');
|
||||
|
||||
assert.equal(searchParams.toString(), 'abc=123');
|
||||
searchParams.forEach((value: string, name: string): void => {
|
||||
searchParams.forEach((value: string, name: string, me: url.URLSearchParams): void => {
|
||||
assert.equal(name, 'abc');
|
||||
assert.equal(value, '123');
|
||||
assert.equal(me, searchParams);
|
||||
});
|
||||
|
||||
assert.equal(searchParams.get('abc'), '123');
|
||||
|
||||
Reference in New Issue
Block a user