Last active
August 9, 2017 08:46
-
-
Save ruizfrontend/ddd9ad7f24ef6df1f393b67d2e9899a4 to your computer and use it in GitHub Desktop.
CSV format URL parameters
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
module.exports = url => url | |
.split('?')[1] | |
.split('&') | |
.map(function(f){ return f.split('=')[0] + ',' + f.split('=')[1]; }) | |
.join('\n'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Process url string and return a CSV formatted list of the parameters.
Example:
will return
Note: If the url don't have parameters will throw an exception