Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 905 Bytes

types.basetypeimpl.construct.md

File metadata and controls

29 lines (17 loc) · 905 Bytes

Home > @skunkteam/types > BaseTypeImpl > construct

BaseTypeImpl.construct() method

Calls any registered parsers or auto-caster, verifies that the resulting value conforms to this Type and returns it if it does.

Signature:

construct(input: unknown): ResultType;

Parameters

Parameter Type Description
input unknown the input value to parse and validate

Returns:

ResultType

Remarks

When given a value that either cannot be parsed by the optional parser or does not conform to the Type, throws an exception.

SomeType(...) is shorthand for SomeType.construct(...)