Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created January 17, 2022 14:36
Show Gist options
  • Save iskenxan/6029d690fca88c9a12b43cf7fe50f32f to your computer and use it in GitHub Desktop.
Save iskenxan/6029d690fca88c9a12b43cf7fe50f32f to your computer and use it in GitHub Desktop.
Typescript schema validation with zod
z.string().optional().array(); // (string | undefined)[]
z.string().array().optional(); // string[] | undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment