UNPKG

@wthek/zod-express-interceptor

Version:

Express middleware interceptor that transforms Zod validation errors into http-error-kit formatted errors.

17 lines 632 B
import type { ErrorRequestHandler } from "express"; /** * Express.js middleware that intercepts all errors and attempts to transform any * Zod validation errors into structured `http-error-kit` errors using the * KitZodTransformer. If the error is not a ZodError, it is left unchanged. * * @returns {import("express").Handler} * @example * * import express from "express"; * import { KitZodExpressInterceptor } from "@wthek/zod-transformer"; * * const app = express(); * app.use(KitZodExpressInterceptor()); */ export declare function KitZodExpressInterceptor(): ErrorRequestHandler; //# sourceMappingURL=index.d.ts.map