zod-tutorial icon indicating copy to clipboard operation
zod-tutorial copied to clipboard

feat: add "or" solution to "07 union problem"

Open NachoVazquez opened this issue 3 years ago • 0 comments


name: Feature request about: Suggest an idea for this project title: 'add "or" solution to "07 union problem"'

What is the motivation/use case for changing the behavior?

When discussing the possible solutions for exercise 07, it would be nice to include the use of "or" as a union alternative.

Describe the solution you'd like

Add the following as a third solution.

const Form = z.object({
  repoName: z.string(),
  privacyLevel: z.literal('private').or(z.literal('public')),
});

NachoVazquez avatar Sep 13 '22 13:09 NachoVazquez