Is there a way to tell zod to use nullish instead of nullable?
See original GitHub issueI’m encountering many cases of:
Type 'number | null | undefined' is not assignable to type 'number | undefined'.
Using nullish instead for optional fields could solve this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
nullable and .default · Issue #425 · colinhacks/zod - GitHub
In which case I request that a "default() for nulls" or "default() handles nulls" be added, since I cannot figure out a way...
Read more >Why does Zod make all my schema fields optional?
I suggest to create a basic version and then extend it with 'passwordConfirmation' and relative refinement. Also is important ...
Read more >TypeScript schema validation with Zod - Iskander Samatov
Schema validation will help you ensure that your data is valid during runtime and Zod is the one of the best TypeScript libraries...
Read more >Nullish Coalescing: The ?? Operator in TypeScript
We can use this operator to provide a fallback value for a value that might be null or undefined . #Truthy and Falsy...
Read more >JavaScript — Better way to check for Nullish values - Medium
We have seen the nullish coalescing operator is really useful when you only care about the null or undefined value for any variable....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Published.
0.5.0 has been published with this change!