3 ms·
With Zod: const info = z.object({ name: z.string().min(1), email: z.string().email() }
by nicky0 4y ago
With Zod:
const info = z.object({
name: z.string().min(1),
email: z.string().email()
}
- ssalbdivad 4y agoHave you seen ArkType (https://github.com/arktypeio/arktype https://github.com/arktypeio/arktype)? Similar parse-based approach to validation with a significantly more concise definition syntax: const info = type({ name: "string>0", email: "email" })
- nicky0 4y agoNo, but I'm a heavy Zod user so ArkType it looks interesting. Thanks for the tip! Are there any compelling reasons to switch apart from the difference in syntax?