Created
August 18, 2022 15:29
-
-
Save sethdavis512/2b39e809ba181c191abee25b034096ae to your computer and use it in GitHub Desktop.
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 encodeGetParams = p => | |
Object.entries(p).map(kv => kv.map(encodeURIComponent).join("=")).join("&"); | |
const params = { | |
user: "María Rodríguez", | |
awesome: true, | |
awesomeness: 64, | |
"ZOMG+&=*(": "*^%*GMOZ" | |
}; | |
console.log("https://example.com/endpoint?" + encodeGetParams(params)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment