safeParse()
Parses and validates the input, returning a Schema.ParseResult object.
safeParse(input: unknown): Schema.ParseResult<Schema.Infer<TBuilder>>;
Notes
- On success, the result contains
success: trueand the parseddata. - On failure, the result contains
success: false, the firsterror, and per-propertyerrorsfor object schemas.
Parameters
- input — The value to validate.
Return value
A result object with either success/data or success/error/errors properties.
Related
class Schema
A class that represents a validation schema for input values, objects, and arrays.
