1 /* eslint-env browser */
4 // "?foo=bar&fish=chips" -> { foo: bar, fish: chips }
5 var parse = function(qs) {
6 if (!qs || qs.length <= 1) return {};
11 .reduce(function(memo, pair) {
12 var splitPair = pair.split('=', 2).map(decodeURIComponent);
14 memo[splitPair[0]] = splitPair[1];
19 let currentWindowSearch = '';
20 if (typeof window !== 'undefined') {
21 currentWindowSearch = window.location.search;
24 module.exports = parse(currentWindowSearch);