UNPKG

@wthek/zod-transformer

Version:

Framework-agnostic utility that transforms Zod validation errors into structured http-error-kit errors. Preserves issue details and integrates cleanly with custom formatters.

10 lines 500 B
/** * Transforms a ZodError into a structured KitHttpError with a BadRequest status. * If the provided error is not an instance of ZodError, it is thrown unchanged. * * @param {unknown} error The error to check and transform. If it is not a ZodError, it is thrown as-is. * @returns {unknown} The transformed error. * @throws {unknown} If the error is not a ZodError, it is thrown as-is. */ export declare function KitZodTransformer(error: unknown): unknown; //# sourceMappingURL=index.d.ts.map