Home > @skunkteam/types > BaseTypeImpl > validate
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>;
Parameter | Type | Description |
---|---|---|
input | unknown | the input value to be validated |
options | ValidationOptions | (Optional) the current validation context |
Returns:
Result<ResultType>
If the given ValidationOptions.mode is 'construct'
(default) it also calls the parser to pre-process the given input.