Skip to content

Interface: WhenOptions<ThenSchema, OtherwiseSchema>

Type Parameters

Type ParameterDefault type
ThenSchemaany
OtherwiseSchemaany

Properties

PropertyTypeDescription
break?booleanwhether to stop applying further conditions if the condition is true.
is?SchemaLike<any>the required condition joi type.
not?SchemaLike<any>the negative version of is (then and otherwise have reverse roles).
otherwise?SchemaLike<OtherwiseSchema>the alternative schema type if the condition is false. Required if then or switch are missing.
switch?(SwitchCases | SwitchDefault)[]the list of cases. Required if then is missing. Required if then or otherwise are missing.
then?SchemaLike<ThenSchema>the alternative schema type if the condition is true. Required if otherwise or switch are missing.