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
constschema=z.object({array: z.string().array().min(42).optional()})// works as expectedconsole.log(schema.safeParse({}).success)// true// works as expectedconsole.log(schema.safeParse({array: []}).success)// false
constschema=z.object({array: z.string().array().min(42)}).deepPartial()// works as expectedconsole.log(schema.safeParse({}).success)// true// should be false, but is trueconsole.log(schema.safeParse({array: []}).success)// true
Hi! So just stumbled upon this, it would appear that something in 3.8 broke the way array().min() works with deepPartial()
If you check this codepen
https://codepen.io/pasco82/pen/GRXmJgV?editors=0011
with v 3.7.1
but with v 3.8.1
Is there a change in syntax i've missed somewhere?
thanks in advance 👍
The text was updated successfully, but these errors were encountered: