-
Notifications
You must be signed in to change notification settings - Fork 933
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
[Proposal] Tuple type #1395
Comments
Hi, just wondering if there was any update on this proposal? Can see the feature has been added in this WIP PR #1546 which has updated the docs but doesn't look like the package has been released since then? |
Ah sorry have just seen this https://github.com/jquense/yup/blob/master/README.md?plain=1#L5 ignore me 🙃 |
Hi @jquense, although the WIP PR I reference earlier was merged (and the docs updated) tuple support is not available in the latest v1 beta release. Do you have any estimate for when it might be released? Thanks in advance |
just released beta.2 |
Yeeeeehaw! Many thanks 🙏 |
The problem
It's a common case that we use arrays not with repeating items but tuples. It's difficult to validate these tuples with existing
yup.array().of()
API.Example case
Say I'm using a
dateRange
field with type[Date, Date]
tuple - a starting date and an ending date.Now I want to apply different validation rules for starting date and ending date, and, I want the validation errors (if any) to be assigned to the
dateRange
field all the same, no matter it comes from starting date or ending date. There's no good way to achieve with existing APIs.The proposal
A new
yup.tuple()
type for validating tuples.The text was updated successfully, but these errors were encountered: