Home > @skunkteam/types > partial
Create a type-validator that validates (or parses) an object structure with only optional properties.
Signature:
declare function partial<Props extends Properties>(
...args: [props: Props] | [name: string, props: Props] | [options: InterfaceTypeOptions, props: Props]
): PartialType<Props>;
Parameter | Type | Description |
---|---|---|
args | [props: Props] | [name: string, props: Props] | [options: InterfaceTypeOptions, props: Props] | the optional name and (required) properties of the new type |
Returns:
PartialType<Props>
This is a basic building block for more complex structured types, can be nested.