Optional Properties was broken
See original GitHub issueIt was worked in 1.0.9 , but broken in 1.2.3 .
export const stackProps = z
.object({
direction: Direction.optional(),
horizontalAlign: Alignment.optional(),
verticalAlign: Alignment.optional(),
wrap: z.boolean().optional(),
grow: z.boolean().optional(),
shrink: z.boolean().optional(),
})
type PropType = z.TypeOf<typeof stackProps>
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TypeScript Optional properties break type enforcement for ...
TypeScript is structurally typed. So based on your definition for Right , all possible values for Wrong are compatible with Right :
Read more >Optional properties in inferred mapped type causes auto- ...
Bug Report Optional properties in inferred mapped type causes auto-completion to break. Search Terms Inferred mapped type with optional ...
Read more >How to Deal with Optional Things and "Undefined" in TypeScript
An uninitialized or absent property of an object; A potentially-omitted optional argument to a function; A return value to indicate something ...
Read more >Why java.util.Optional is broken
As a consequence of this property of not being able to change the structure, we can derive other properties of things that can...
Read more >What is wrong with optional chaining and how to fix it
Lets say I do have a function which I want to call on the property which is a result of the optional chaining....
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
Thanks for your awesome work!
Should be fixed in 1.2.4 - not sure how that got past my tests 😕
Sorry about that!