Skip to content

alternatives() #142

@hueniverse

Description

@hueniverse

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()
];

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions