Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.34 KB

types.partial.md

File metadata and controls

29 lines (18 loc) · 1.34 KB

Home > @skunkteam/types > partial

partial() function

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>;

Parameters

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>

Remarks

This is a basic building block for more complex structured types, can be nested.