Skip to content
New issue

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

keyof PickByValue<ObjectWithOptionals, SomeType> gives union with undefined #123

Closed
vatosarmat opened this issue Nov 8, 2019 · 1 comment · Fixed by #124
Closed

keyof PickByValue<ObjectWithOptionals, SomeType> gives union with undefined #123

vatosarmat opened this issue Nov 8, 2019 · 1 comment · Fixed by #124

Comments

@vatosarmat
Copy link
Contributor

Description

PickByValue, PickByValueExact and maybe other operators Picking keys union created via "conditional mapping" produce types with "hidden" undefined key when used on type with optional properties. Applying keyof to such types gives ACTUAL_KEYS | undefined.

Details and suggested fix here:
microsoft/TypeScript#34992

Steps to Reproduce

Playground

@piotrwitek
Copy link
Owner

Suggested fix looks good, let's make it happen! Accepting PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants