Last active
April 8, 2024 20:27
-
-
Save aizatto/c1f42416034cf0e3303c85f4dd251334 to your computer and use it in GitHub Desktop.
Merge Query Strings (Node.js)
This file contains 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 url = require('url') | |
const appendQueryString = (url_string, query_string_object) => { | |
const parsed_url = url.parse(url_string, true); | |
parsed_url.query = Object.assign( | |
parsed_url.query, | |
query_string_object, | |
); | |
return url.format(parsed_url); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment