Home > @skunkteam/types > BaseTypeImpl > construct
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;
Parameter | Type | Description |
---|---|---|
input | unknown | the input value to parse and validate |
Returns:
ResultType
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(...)