Skip to content

Commit

Permalink
updated function name
Browse files Browse the repository at this point in the history
  • Loading branch information
stephensprinkle committed Aug 21, 2017
1 parent 111eda6 commit 8a5d7f4
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/modules/app/helpers/parse-query.js
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
/**
* Parses the raw query string into a formatted array
* @param {string} searchString - The raw query param string
* @returns {object}
*/
export default function parseSearch(searchString) {
let pairSplit;
return (searchString || '').replace(/^\?/, '').split('&').reduce((p, pair) => {
pairSplit = pair.split('=');
if (pairSplit.length >= 1) {
if (pairSplit[0].length) {
if (pairSplit.length >= 2 && pairSplit[1]) {
p[decodeURIComponent(pairSplit[0])] = decodeURIComponent(pairSplit[1]);
} else {
p[decodeURIComponent(pairSplit[0])] = '';
}
}
}
return p;
}, {});
}

0 comments on commit 8a5d7f4

Please sign in to comment.