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

alternatives() #142

Closed
hueniverse opened this issue Nov 14, 2013 · 0 comments
Closed

alternatives() #142

hueniverse opened this issue Nov 14, 2013 · 0 comments
Assignees
Labels
feature New functionality or improvement
Milestone

Comments

@hueniverse
Copy link
Contributor

Wrap current [] support to apply same common properties:

Joi.alternatives([
    string(),
    number()
]).required();

This replaces the current need to specify shared properties on each alternative type:

[
    string().require(),
    number().required()
];
@hueniverse hueniverse added this to the 2.8.0 milestone Mar 11, 2014
@hueniverse hueniverse self-assigned this Mar 11, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

1 participant