Created
April 4, 2018 11:09
-
-
Save Dzinlife/efca143d7653cef9ab3e54cb3360f328 to your computer and use it in GitHub Desktop.
query2Object
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
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