(error: ZodError)
| 46 | }; |
| 47 | |
| 48 | export const createZodError = (error: ZodError) => { |
| 49 | return new WebinyError({ |
| 50 | message: `Validation failed.`, |
| 51 | code: "VALIDATION_FAILED_INVALID_FIELDS", |
| 52 | data: createValidationErrorData(error) |
| 53 | }); |
| 54 | }; |
| 55 | |
| 56 | export const parseZodError = (error: ZodError): ValidationIssue[] => { |
| 57 | return error.issues.map(issue => ({ |
no test coverage detected