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