zod-error
Version:
Utilities to format and customize Zod error messages
16 lines (15 loc) • 529 B
TypeScript
import { ErrorMessageOptions } from '../../types';
import { z } from 'zod';
/**
* Asynchronously parses a Zod schema
* and throws a generic error.
* Only required if schema contains async
* .refine() or .transform() functions.
* @export
* @template T
* @param {T} schema
* @param {unknown} data
* @param {ErrorMessageOptions} [options]
* @return {*} {Promise<T['_output']>}
*/
export declare function parseAsync<T extends z.ZodTypeAny>(schema: T, data: unknown, options?: ErrorMessageOptions): Promise<T['_output']>;