-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add params to an url who already have params #151
Comments
@mehdihaddad Nice catch !!
|
To check : var objURL = new URL(url)
if(objURL.search.length > 1) {
// Yes, i already have queryParams
} else {
// Nope !
} .search give you only the queryParams string like |
Maybe a regex would be better, because of url value. In urlcat you can have |
Hello, would it be possible to fix this? |
Thanks for reporting this, @mehdihaddad. Could you please show me a realistic use case where this: const url = 'http://myurl.com'
urlcat(url, {foo: 2, bar: 3, myparams: 1}) wouldn't solve the problem? |
Closing this for now. If someone can demonstrate that this would be a useful feature to have, I'll reopen the issue. |
A realistic use case is when you just want to ensure a url, which may already have query params, contains a specific set of params, like the first post demonstrated. |
@iSplasher reopening because there seems to be demand for this feature. |
FIX: Add params to an url who already have params balazsbotond#151
For exemple,
OUTPUT: http://myurl.com?myparams=1?foo=2&bar=2
WANTED: http://myurl.com?myparams=1&foo=2&bar=2
The text was updated successfully, but these errors were encountered: