summaryrefslogtreecommitdiff
path: root/packages/taler-util/src/whatwg-url.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-util/src/whatwg-url.ts')
-rw-r--r--packages/taler-util/src/whatwg-url.ts20
1 files changed, 16 insertions, 4 deletions
diff --git a/packages/taler-util/src/whatwg-url.ts b/packages/taler-util/src/whatwg-url.ts
index a0fe55d8f..991528ae6 100644
--- a/packages/taler-util/src/whatwg-url.ts
+++ b/packages/taler-util/src/whatwg-url.ts
@@ -347,8 +347,7 @@ function isASCIIHex(c: number) {
export class URLSearchParamsImpl {
_list: any[];
_url: any;
- constructor(constructorArgs: any[], { doNotStripQMark = false }: any) {
- let init = constructorArgs[0];
+ constructor(init: any, { doNotStripQMark = false }: any = {}) {
this._list = [];
this._url = null;
@@ -425,6 +424,19 @@ export class URLSearchParamsImpl {
return output;
}
+ forEach(
+ callbackfn: (
+ value: string,
+ key: string,
+ parent: URLSearchParamsImpl,
+ ) => void,
+ thisArg?: any,
+ ): void {
+ for (const tuple of this._list) {
+ callbackfn.call(thisArg, tuple[1], tuple[0], this);
+ }
+ }
+
has(name: string) {
for (const tuple of this._list) {
if (tuple[0] === name) {
@@ -1916,7 +1928,7 @@ export class URLImpl {
// We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips
// question mark by default. Therefore the doNotStripQMark hack is used.
- this._query = new URLSearchParamsImpl([query], {
+ this._query = new URLSearchParamsImpl(query, {
doNotStripQMark: true,
});
this._query._url = this;
@@ -2104,4 +2116,4 @@ export class URLImpl {
// FIXME: type!
_url: any;
_query: any;
-} \ No newline at end of file
+}