summaryrefslogtreecommitdiff
path: root/node_modules/snekfetch/src/qs_mock.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/snekfetch/src/qs_mock.js')
-rw-r--r--node_modules/snekfetch/src/qs_mock.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/snekfetch/src/qs_mock.js b/node_modules/snekfetch/src/qs_mock.js
new file mode 100644
index 0000000..a8e4807
--- /dev/null
+++ b/node_modules/snekfetch/src/qs_mock.js
@@ -0,0 +1,9 @@
+exports = {
+ parse: (str) => {
+ const parsed = {};
+ for (const [k, v] of new Window.URLSearchParams(str).entries())
+ parsed[k] = v;
+ return parsed;
+ },
+ stringify: (obj) => new window.URLSearchParams(obj).toString(),
+};