summaryrefslogtreecommitdiff
path: root/js/url_search_params.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/url_search_params.ts')
-rw-r--r--js/url_search_params.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/url_search_params.ts b/js/url_search_params.ts
index 85f4c0619..666ba6951 100644
--- a/js/url_search_params.ts
+++ b/js/url_search_params.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { URL } from "./url";
-import { requiredArguments } from "./util";
+import { requiredArguments, isIterable } from "./util";
export class URLSearchParams {
private params: Array<[string, string]> = [];
@@ -17,6 +17,11 @@ export class URLSearchParams {
return;
}
+ if (isIterable(init)) {
+ this.params = [...init];
+ return;
+ }
+
if (Object(init) !== init) {
return;
}