Constructors
Methods
Static
validateSchema
- validateSchema(data, schema): boolean | default<ResponseErrorType>
Parameters
- data: any
- schema: ZodObject<any, UnknownKeysParam, ZodTypeAny, {}, {}> | ZodUnion<any> | ZodIntersection<any, any>
- Returns either true if the data is valid or a Response object with an error message if validation fails.
Validates the given data against the provided schema.
Param: data
The data to be validated.
Param: schema
The schema to validate against.
Returns