-
-
Notifications
You must be signed in to change notification settings - Fork 452
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
How to skip duplicate key in query string #293
Comments
It's not immediately clear to me exactly what you are asking. An example might go a long way. |
For example |
I think #210 would solve this, as you could define that |
I'd also really like to see this for making TypeScript code more succinct. Maybe something like Current code looks like: function doThingWithParam(param: string) {
// ...
}
// param type is string | string[] | null
let { param } = qs.parse(search);
if (Array.isArray(param)) {
param = param[0];
}
doThingWithParam(param); ideally it'd be something like // param type is string | null
let { param } = qs.parse(search, { arrayFormat: 'ignore' });
doThingWithParam(param); |
+1 on this |
Could not find a from to post this question in so posting it here. How can I skip a key that has already been parsed/added? Is there an option I can add to queryString.parse(location.search) to ignore duplicates?
The text was updated successfully, but these errors were encountered: