@sentzunhat/zacatl
Version:
A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.
12 lines • 423 B
JavaScript
export const applyZodSchema = async (schema, req) => {
if (schema == null)
return;
const s = schema;
if (s.body != null)
req.body = await s.body.parseAsync(req.body);
if (s.querystring != null)
req.query = (await s.querystring.parseAsync(req.query));
if (s.params != null)
req.params = (await s.params.parseAsync(req.params));
};
//# sourceMappingURL=schema-helper.js.map