Skip to content

Commit 3de2b63

Browse files
yz89122claude
andauthored
fix: remove redundant Required<> from input and output type definitions (#5033)
The Required<> utility type was redundant in both input and output type definitions because the type guards already ensure these are required properties. If they were optional, the conditions would fail and return 'unknown'. This redundant mapped type caused TS2615 circular reference errors in TypeScript 5.9+. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent d43cf19 commit 3de2b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/zod/src/v4/core/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export class $ZodAsyncError extends Error {
8484
// export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
8585
// export type input<T extends schemas.$ZodType> = T["_zod"]["input"];
8686
// export type output<T extends schemas.$ZodType> = T["_zod"]["output"];
87-
export type input<T> = T extends { _zod: { input: any } } ? Required<T["_zod"]>["input"] : unknown;
88-
export type output<T> = T extends { _zod: { output: any } } ? Required<T["_zod"]>["output"] : unknown;
87+
export type input<T> = T extends { _zod: { input: any } } ? T["_zod"]["input"] : unknown;
88+
export type output<T> = T extends { _zod: { output: any } } ? T["_zod"]["output"] : unknown;
8989

9090
// Mk2
9191
// export type input<T> = T extends { _zod: { "~input": any } }

0 commit comments

Comments
 (0)