Last active
June 1, 2016 22:27
-
-
Save shanimal/0be546bbdbb164ce1c8e3ba78b590fb1 to your computer and use it in GitHub Desktop.
Code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* parseURIData(location.search.substr(1)); | |
* @param search | |
* @returns {*} | |
*/ | |
module.exports = function (search) { | |
var result = {}; | |
if(!search.length){ | |
return result; | |
} | |
return search.split('&').reduce(function (e, v) { | |
var split = v.split('='); | |
e[split[0]] = decodeURIComponent(split[1]); | |
return e; | |
},result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment