1.11
.safeParse
on all schemas — this lets you validate data in a more functional way, similar toio-ts
: https://github.com/vriad/zod#safe-parse.regex
method on string schemas: https://github.com/vriad/zod#strings.primitives()
and.nonprimitives()
methods on object schemas — quickly pick or omit primitive fields from objects, useful for validating API inputs: https://github.com/vriad/zod#primitives-and-nonprimitivesz.nativeEnum()
— create a Zod schema from an existing TypeScriptenum
: https://github.com/vriad/zod#native-enums