Created
September 11, 2020 13:10
-
-
Save minipai/6cc29efaad43e5ecf436f2d88c811ece to your computer and use it in GitHub Desktop.
query-string native replacement
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 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