Skip to content
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

Support regex for arrayFormat #341

Open
phuhd-0935 opened this issue Jun 23, 2022 · 3 comments
Open

Support regex for arrayFormat #341

phuhd-0935 opened this issue Jun 23, 2022 · 3 comments

Comments

@phuhd-0935
Copy link

I have an issue with array params url:
1.
?categoryIds=1&categoryIds=2 => categoryIds=['1', '2'] : Right
2.
?categoryIds=1 => categoryIds='1' : Wrong
=> Expect: categoryIds=['1']
Could you add regex option for arrayFormat ? Or everyone have a solution for this.
Big thanks to you 🙇

@sindresorhus
Copy link
Owner

What would a regex format do and how would it solve your problem?

@phuhd-0935
Copy link
Author

@sindresorhus
An Select/dropdown required array value (it was auto fill value from route params when reload). I can hand over 1 or 2 case by convert string to array, but with more select/dropdown, it's hard to control

@sindresorhus
Copy link
Owner

I don't think regex is the proper solution for this. #228 (comment) would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants