Skip to content

Instantly share code, notes, and snippets.

@minipai
Created September 11, 2020 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minipai/6cc29efaad43e5ecf436f2d88c811ece to your computer and use it in GitHub Desktop.
Save minipai/6cc29efaad43e5ecf436f2d88c811ece to your computer and use it in GitHub Desktop.
query-string native replacement
const SearchParams = {
parse(queryString) {
return Object.fromEntries(new URLSearchParams(queryString).entries())
},
stringify(query) {
return new URLSearchParams(query).toString()
}
}
export default SearchParams
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment