12 lines
830 B
TypeScript
12 lines
830 B
TypeScript
import { Request, Response, NextFunction } from 'express';
|
|
import { type ZodType } from 'zod';
|
|
/**
|
|
* Validates `req.body` against a Zod schema and replaces it with parsed output.
|
|
* Returns 400 with a generic message (no field-level leak in production responses).
|
|
*/
|
|
export declare function validateBody<T extends ZodType>(schema: T): (req: Request, res: Response, next: NextFunction) => void;
|
|
/** Validates `req.query` and replaces it with coerced, typed output. */
|
|
export declare function validateQuery<T extends ZodType>(schema: T): (req: Request, res: Response, next: NextFunction) => void;
|
|
/** Validates `req.params` and replaces it with parsed output. */
|
|
export declare function validateParams<T extends ZodType>(schema: T): (req: Request, res: Response, next: NextFunction) => void;
|
|
//# sourceMappingURL=validate.d.ts.map
|