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