-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
base: main
Are you sure you want to change the base?
Conversation
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 }
@microsoft-github-policy-service agree |
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. |
If the test results and self check are indicative, this seems pretty breaky. @typescript-bot test it |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing Something interesting changed - please have a look. Details
|
@jakebailey Here are the results of running the top 400 repos with tsc comparing Something interesting changed - please have a look. Details
|
Fixes #60859