You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zod types generate function always carry a unknown[] args.
But it's a difference from (...args: unknown[]) => string; between () => string;
Code
import{z}from"zod";constmyFunction=z.function().returns(z.string());// MyFunction1 type is (...args: unknown[]) => string;typeMyFunction1=z.infer<typeofmyFunction>;constf1: MyFunction1=(x1: string)=>"";// Expect type is () => string;typeMyFunction2=()=>string;constf2: MyFunction2=()=>"";
The text was updated successfully, but these errors were encountered:
GiveMe-A-Name
changed the title
[Bug]Zod function types not inferred correctly
Bug: Zod function types not inferred correctly
Sep 26, 2024
Detail
Zod types generate function always carry a unknown[] args.
But it's a difference from
(...args: unknown[]) => string;
between() => string;
Code
The text was updated successfully, but these errors were encountered: