NULLABLE()function

NULLABLE(source: Schema<T>): NullableSchema<T>
ParamType
sourceSchema<T>
Source schema to wrap. required
Return
NullableSchema<T>
Schema that wraps a source schema and additionally allows null.

Create a NullableSchema that wraps a source schema and also allows null.

Sugar factory for NullableSchema.

Examples

const schema = NULLABLE(STRING);
 schema.validate(""); // Returns null