Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.32 KB

types.object.md

File metadata and controls

29 lines (18 loc) · 1.32 KB

Home > @skunkteam/types > object

object() function

Create a type-validator that validates (or parses) an object structure.

Signature:

declare function object<Props extends Properties>(
    ...args: [props: Props] | [name: string, props: Props] | [options: InterfaceTypeOptionsWithPartial, props: Props]
): FullType<Props>;

Parameters

Parameter Type Description
args [props: Props] | [name: string, props: Props] | [options: InterfaceTypeOptionsWithPartial, props: Props] the options and properties of the new type

Returns:

FullType<Props>

Remarks

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