diff --git a/packages/schemas/src/foundations/schemas.ts b/packages/schemas/src/foundations/schemas.ts index 5d4c34a9b..f07a96963 100644 --- a/packages/schemas/src/foundations/schemas.ts +++ b/packages/schemas/src/foundations/schemas.ts @@ -1,8 +1,10 @@ -import { ZodObject, ZodType } from 'zod'; +import { ZodObject, ZodType, ZodOptional } from 'zod'; export type Guard> = ZodObject< { - [key in keyof T]: ZodType; + [key in keyof T]-?: undefined extends T[key] + ? ZodOptional>> + : ZodType; } >;