Skip to content

Instantly share code, notes, and snippets.

@SadPandaBear
Created August 17, 2018 13:33
Show Gist options
  • Save SadPandaBear/8f7114c305a4d974c7dc1e6f87d4ee8f to your computer and use it in GitHub Desktop.
Save SadPandaBear/8f7114c305a4d974c7dc1e6f87d4ee8f to your computer and use it in GitHub Desktop.
const queryStringToJSON = query => (
query.slice(1).split('&').map(d => d.split('=')).reduce(
(acc, [head, tail]) => ({ ...acc, [head]: tail }), 0)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment