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

Fix types for Object.entries/Object.fromEntries #61074

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nezo32
Copy link

@nezo32 nezo32 commented Jan 29, 2025

Fixes #60859

Added an optional generic type with string as the default type for the object argument in Object.entries. This makes the typing of this function “end-to-end”. For example, if Record<“value1” | “value2”, string> is passed as an argument, the output value will be [“value1” | “value2”, string][]
Added an optional generic type with PropertyKey as the default type for the object argument in Object.fromEntries. This makes the typing of this function “end-to-end”. For example, if [ “value1” | “value2”, string ][] is passed as an argument, the output value will be { [Key in “value1” | “value2”]: string }
@nezo32
Copy link
Author

nezo32 commented Jan 29, 2025

@microsoft-github-policy-service agree

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jan 30, 2025
@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue #60859. If you can get it accepted, this PR will have a better chance of being reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
2 participants