nullable()
nullable<
T>(schema,message?):NullableSchema<Schema<T>>
Makes a schema nullable (accepts null).
Type Parametersβ
T: Tβ
Parametersβ
schema: Schema<T>β
The schema to make nullable
message?: stringβ
Custom error message
Returns: NullableSchema<Schema<T>>β
Schema that accepts the original type or null
Sinceβ
2.0.0