literal()
literal<
T>(value,message?):LiteralSchema<T>
Literal schema - accepts only a specific value.
Type Parameters
T: T extends string | number | boolean
Parameters
value: T
The literal value to validate against.
message?: string
Custom error message.
Returns: LiteralSchema<T>
Schema that validates only this specific value.
Since
2.0.0