8000 v4: `z.object().check()` types the `value` property as `any` · Issue #4326 · colinhacks/zod · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

v4: z.object().check() types the value property as any #4326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bryanforbes opened this issue May 5, 2025 · 0 comments
Open

v4: z.object().check() types the value property as any #4326

bryanforbes opened this issue May 5, 2025 · 0 comments

Comments

@bryanforbes
Copy link
bryanforbes commented May 5, 2025

Using @zod/mini version 4.0.0-beta.20250505T195954, the the following code has incorrect type information for the check function:

const Thing = z.object({
  name: z.string(),
  age: z.number()
}).check(({ value, issues }) => {
});

type ThingOutput = z.infer<typeof Thing> // { name: string; age: number }
type ThingInput = z.input<typeof Thing> // { name: string; age: number }
Image

With the previous beta, z.interface() would give the correct type for value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0