UNPKG

@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.

21 lines (18 loc) 421 B
import z from "zod"; export const makeSchema = <T extends z.ZodRawShape>( schema: z.ZodObject<T> ): z.ZodObject<T> => { return schema; }; export const makeWithDefaultResponse = <T extends z.ZodRawShape>( schema: z.ZodObject<T> ): z.ZodObject<{ ok: z.ZodBoolean; message: z.ZodString; data: z.ZodObject<T>; }> => z.object({ ok: z.boolean(), message: z.string(), data: makeSchema(schema), });