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
Object with nested define doesn't apply transform before superRefine, causing superRefine to not be typesafe.
constres=z.object({name: z.string(),age: z.number().refine((data)=>{returndata>18;}),// Fails refine}).transform((data)=>{return{userName: data.name,userAge: data.age,};}).superRefine((data)=>{// Data here is { "name": "John", "age": 6 }, Expected { "userName": "John", "userAge": 6} after transformationconsole.log("superRefine",JSON.stringify(data,null,2));}).safeParse({name: "John",age: 6,});console.log(res);
This parsing should abort early or perform the transformation anyway. Transform isn't applied here.
The text was updated successfully, but these errors were encountered:
matowang
changed the title
If object with nested refine fails, it doesn't apply transform before superRefine, causing supertRefine to not be typesafe
If object with nested refine fails, it doesn't apply transform before superRefine, causing superRefine to not be typesafe
Jun 14, 2024
Object with nested define doesn't apply transform before superRefine, causing superRefine to not be typesafe.
This parsing should abort early or perform the transformation anyway. Transform isn't applied here.
The text was updated successfully, but these errors were encountered: