Created
November 16, 2016 20:58
-
-
Save rtanikella/bc9ac2cc04fc75ee2d0d46cd410eb429 to your computer and use it in GitHub Desktop.
A one-liner to decode a URI in Node.js (I use this in REPL mode)
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
// Note that in Node.js REPL mode the ':' and ',' are not decoded by decodeURI(). Hence the regexes. | |
decodeURI("Text to decode").replace(/%2C/g,",").replace(/%3A/g,":"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment