We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"prop" in obj && obj.prop
Optional chaining solved this in the javascript world, but typescript just doesn't like this looser js-style code.
I wish I could just write:
obj?.prop
Instead of:
when obj is:
type Obj = { prop: string } | { error: string, code: number }
Maybe something like a lodash.get could solve this, using some typescript magic.
Related twitter thread: https://twitter.com/mattpocockuk/status/1579834794472771584
The text was updated successfully, but these errors were encountered:
"prop" in obj&&obj.prop
No branches or pull requests
Optional chaining solved this in the javascript world, but typescript just doesn't like this looser js-style code.
I wish I could just write:
Instead of:
when obj is:
Maybe something like a lodash.get could solve this, using some typescript magic.
Related twitter thread: https://twitter.com/mattpocockuk/status/1579834794472771584
The text was updated successfully, but these errors were encountered: