UNPKG

@ladislaogarcia/prisma-trpc-generator

Version:

Prisma 2+ generator to emit fully implemented tRPC routers

17 lines (15 loc) 325 B
import { ZodError } from 'zod'; export default { errorFormatter({ shape, error }) { return { ...shape, data: { ...shape.data, zodError: error.code === 'BAD_REQUEST' && error.cause instanceof ZodError ? error.cause.flatten() : null, }, }; }, };