Created
January 17, 2022 14:35
-
-
Save iskenxan/cc52100844ed4d9fdaf3a6f2f3e2a268 to your computer and use it in GitHub Desktop.
Typescript schema validation with zod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mySchema.safeParse(""I am a valid password""); // => { success: true; data: "I am a valid password" } | |
mySchema.safeParse(""); // => { success: false; error: ZodError } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment