Aller au contenu principal

mixedEnum()

mixedEnum<T>(values, message?): EnumSchema<T[number]>

Mixed enum schema - enumeration of mixed types


Type Parameters

T: T extends readonly [EnumValue, EnumValue]


Parameters

values: T

Array of allowed mixed values (string | number | boolean)

message?: string

Custom error message


Returns: EnumSchema<T[number]>

Schema that validates only the mixed enum values


Since

2.0.0