You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot @sindresorhus for drawing my attention on exactOptionalPropertyTypes which was unknown to me. For anyone who also thought strict is the strictest you can get, I found this article quite helpful.
At the moment I am unable to reproduce the issue, I may have been working with an older typescript version. It seems to work as expected. exactOptionalPropertyTypes should not be required. Closing it for now.
I would have expected the type
b
to be: (1)however the type seems to be
Is there a way to enforce the presence of the key but not require the value to be defined (like (1))?
This can be manually achieved with this type definition:
But this is a bit more cumbersome.
Upvote & Fund
The text was updated successfully, but these errors were encountered: