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
Closed
@bryanforbes

Description

@bryanforbes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0