Skip to content

Instantly share code, notes, and snippets.

@Dzinlife
Created April 4, 2018 11:09
Show Gist options
  • Save Dzinlife/efca143d7653cef9ab3e54cb3360f328 to your computer and use it in GitHub Desktop.
Save Dzinlife/efca143d7653cef9ab3e54cb3360f328 to your computer and use it in GitHub Desktop.
query2Object
const params = {}
query.replace(/([^=?#&]*)=([^?#&]*)/g, function(e, $1, $2) {
params[decodeURIComponent($1)] = decodeURIComponent($2)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment