79429312

Date: 2025-02-11 08:33:14
Score: 1
Natty:
Report link
 const schema = z
  .object({
    email: z.string().email().optional(),
    userName: z.string().optional(),
    contactType: z.string(),
  })
  .refine((data) =>
    data.contactType === 'email' && !data.email) ?
      z.string().nonempty() : z.unknown()
  });
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: lindern