Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 1.17 KB

types.basetypeimpl.validate.md

File metadata and controls

28 lines (17 loc) · 1.17 KB

Home > @skunkteam/types > BaseTypeImpl > validate

BaseTypeImpl.validate() method

Validates that a value conforms to this type, and returns a result indicating success or failure (does not throw).

Signature:

validate(input: unknown, options?: ValidationOptions): Result<ResultType>;

Parameters

Parameter Type Description
input unknown the input value to be validated
options ValidationOptions (Optional) the current validation context

Returns:

Result<ResultType>

Remarks

If the given ValidationOptions.mode is 'construct' (default) it also calls the parser to pre-process the given input.