PARTIAL()function
PARTIAL(source: Schemas<T> | DataSchema<T>): DataSchema<PartialData<T>>
| Param | Type | |
|---|---|---|
source | Schemas<T>DataSchema<T> | The props schemas or an existing DataSchema to make partial. required |
| Return | |
|---|---|
DataSchema<PartialData<T>> | A DataSchema whose every property is optional. |
Create a DataSchema that validates partially, i.e. every property can be its value or undefined.
Sugar factory for DataSchema.
Examples
PARTIAL({ name: STRING, age: NUMBER }) // DataSchema<{ name?: string; age?: number }>