mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
feat(ext/url): URLSearchParams.size (#17884)
This commit is contained in:
parent
1930c09b04
commit
eb990efcce
3 changed files with 14 additions and 0 deletions
|
@ -302,6 +302,11 @@ class URLSearchParams {
|
|||
webidl.assertBranded(this, URLSearchParamsPrototype);
|
||||
return ops.op_url_stringify_search_params(this[_list]);
|
||||
}
|
||||
|
||||
get size() {
|
||||
webidl.assertBranded(this, URLSearchParamsPrototype);
|
||||
return this[_list].length;
|
||||
}
|
||||
}
|
||||
|
||||
webidl.mixinPairIterable("URLSearchParams", URLSearchParams, _list, 0, 1);
|
||||
|
|
8
ext/url/lib.deno_url.d.ts
vendored
8
ext/url/lib.deno_url.d.ts
vendored
|
@ -150,6 +150,14 @@ declare class URLSearchParams {
|
|||
* ```
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/** Contains the number of search parameters
|
||||
*
|
||||
* ```ts
|
||||
* searchParams.size
|
||||
* ```
|
||||
*/
|
||||
size: number;
|
||||
}
|
||||
|
||||
/** The URL interface represents an object providing static methods used for
|
||||
|
|
|
@ -2090,6 +2090,7 @@
|
|||
"urlsearchparams-has.any.worker.html": true,
|
||||
"urlsearchparams-set.any.html": true,
|
||||
"urlsearchparams-set.any.worker.html": true,
|
||||
"urlsearchparams-size.any.html": true,
|
||||
"urlsearchparams-sort.any.html": true,
|
||||
"urlsearchparams-sort.any.worker.html": true,
|
||||
"urlsearchparams-stringifier.any.html": true,
|
||||
|
|
Loading…
Reference in a new issue