Skip to content

Instantly share code, notes, and snippets.

@luislobo14rap
Last active December 5, 2022 14:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save luislobo14rap/5cb65463c9d49ce58d3aed143846f0fd to your computer and use it in GitHub Desktop.
Save luislobo14rap/5cb65463c9d49ce58d3aed143846f0fd to your computer and use it in GitHub Desktop.
// unserialize.js v1.0.1
function unserialize(serialize) {
let obj = {};
serialize = serialize.split('&');
for (let i = 0; i < serialize.length; i++) {
thisItem = serialize[i].split('=');
obj[decodeURIComponent(thisItem[0])] = decodeURIComponent(thisItem[1]);
};
return obj;
};
// unserialize.min.js v1.0.1
function unserialize(serialize){let obj={};serialize=serialize.split('&');for(let i=0;i<serialize.length;i++){thisItem=serialize[i].split('=');obj[decodeURIComponent(thisItem[0])]=decodeURIComponent(thisItem[1])};return obj}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment