question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Optional Properties was broken

See original GitHub issue

It 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>

image image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tuoxianspcommented, Apr 17, 2020

Thanks for your awesome work!

1reaction
colinhackscommented, Apr 17, 2020

Should be fixed in 1.2.4 - not sure how that got past my tests 😕

Sorry about that!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found