Aller au contenu principal

nullish()

nullish<T>(schema, message?): NullishSchema<Schema<T>>

Makes a schema nullish (accepts null or undefined).


Type Parameters​

T: T​


Parameters​

schema: Schema<T>​

The schema to make nullish.

message?: string​

Custom error message.


Returns: NullishSchema<Schema<T>>​

Schema that accepts the original type, null, or undefined.


Since​

2.0.0