8000 @zod/mini: `pipe` rejects out schemas with wider input than specified · Issue #4130 · colinhacks/zod · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

@zod/mini: pipe rejects out schemas with wider input than specified #4130

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

Closed
EskiMojo14 opened this issue Apr 12, 2025 · 1 comment
Closed

Comments

@EskiMojo14
Copy link

TS playground

A schema such as the below:

zMini.pipe(
  zMini.pipe(
    zMini.string().check(zMini.regex(ISO_DATE)),
    zMini.transform((v) => new Date(v)),
  ),
  zMini.date().check(zMini.maximum(new Date())),
);

errors with the message:

Argument of type 'ZodMiniDate<unknown>' is not assignable to parameter of type '$ZodType<unknown, Date>'.
  The types of '_zod.input' are incompatible between these types.
    Type 'unknown' is not assignable to type 'Date'.(2345)
@EskiMojo14 EskiMojo14 changed the title v4: pipe rejects out schemas with wider input than specified @zod/mini: pipe rejects out schemas with wider input than specified Apr 12, 2025
@colinhacks
Copy link
Owner
colinhacks commented May 15, 2025

Fixed in the latest betas. This was an issue with the input type of zMini.date(). Apologies for the delay.

Note that you'll need to rewrite your v4 imports to "zod/v4" after upgrading; for more information, see #4364

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

2 participants
0