Skip to content

Commit

Permalink
Merge pull request #1877 from tordans/patch-2
Browse files Browse the repository at this point in the history
Readme: Add intro to chapter Literals
  • Loading branch information
JacobWeisenburger committed Jan 13, 2023
2 parents 744fc38 + 5a7f577 commit cce4e4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ z.coerce.boolean().parse(null); // => false
## Literals
Literals are zod's equivilant to [TypeScript's Literal Types](https://www.typescriptlang.org/docs/handbook/literal-types.html) which alow only the exact given type and value.
```ts
const tuna = z.literal("tuna");
const twelve = z.literal(12);
Expand Down

0 comments on commit cce4e4f

Please sign in to comment.