(
schema: T,
data: ZodInputLooseAutocomplete<T>,
context: SchemaValidationContext = {},
)
| 50 | } |
| 51 | |
| 52 | export async function validateAsync<T extends ZodType>( |
| 53 | schema: T, |
| 54 | data: ZodInputLooseAutocomplete<T>, |
| 55 | context: SchemaValidationContext = {}, |
| 56 | ): Promise<z.output<T>> { |
| 57 | const result = await schema.safeParseAsync(data); |
| 58 | if (result.success) { |
| 59 | return result.data; |
| 60 | } |
| 61 | throw new SchemaValidationError(result.error, schema, context); |
| 62 | } |
no outgoing calls
no test coverage detected