Haha-Yes/node_modules/snekfetch/src/qs_mock.js

10 lines
237 B
JavaScript
Raw Normal View History

2018-09-06 15:02:53 +02:00
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(),
};