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
When an array is one of the options in z.union inside z.object, the inferred type becomes (UnionType) & (UnionType | undefined) instead of just UnionType.
constUnionType=z.object({test: z.union([z.string(),z.number()])});typeUnionType=z.infer<typeofUnionType>// { test: string | number }constUnionTypeBug=z.object({test: z.union([z.string(),z.number().array()])});typeUnionTypeBug=z.infer<typeofUnionTyptBug>// { test: (string | number[]) & (string | number[] | undefined) }, should be { test: string | number[] }
gdziew, moraesvic, freeatnet, jon-dez, 90dy and 13 more