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

v6: undefined Added to Record Type #459

Closed
joealden opened this issue May 19, 2024 · 1 comment · Fixed by #463
Closed

v6: undefined Added to Record Type #459

joealden opened this issue May 19, 2024 · 1 comment · Fixed by #463
Labels
Status: Released It's now live. Type: Bug Inconsistencies or issues which will cause a problem for users or implementors.

Comments

@joealden
Copy link

joealden commented May 19, 2024

Bug Report

When upgrading from 5.1.0 to 6.0.0, merging two records that both have types of Record<string, string> results in a type of { [x: string]: string | undefined; }, when I'd expect it to be { [x: string]: string; }.

EDIT: I understand that Record<string, string> isn't actually accurate for a concrete object that isn't proxied (as any properties not defined won't actually exist, so will be undefined), but if foo and bar have that type, I'd expect it to be respected (like it is in 5.1.0).

Expected behavior

const foo: Record<string, string> = { fooProp: "" };
const bar: Record<string, string> = { barProp: "" };
const result = deepmerge(foo, bar);
//         ^? result: { [x: string]: string; }

Actual behavior

const foo: Record<string, string> = { fooProp: "" };
const bar: Record<string, string> = { barProp: "" };
const result = deepmerge(foo, bar);
//         ^? result: { [x: string]: string | undefined; }
@joealden joealden added Status: Triage This issue needs to be triaged. Type: Bug Inconsistencies or issues which will cause a problem for users or implementors. labels May 19, 2024
@RebeccaStevens RebeccaStevens removed the Status: Triage This issue needs to be triaged. label May 19, 2024
RebeccaStevens added a commit that referenced this issue May 20, 2024
RebeccaStevens added a commit that referenced this issue May 20, 2024
RebeccaStevens added a commit that referenced this issue May 20, 2024
github-actions bot pushed a commit that referenced this issue May 20, 2024
## [6.0.1](v6.0.0...v6.0.1) (2024-05-20)

### Bug Fixes

* type when merging index signatures ([5e8b9b6](5e8b9b6)), closes [#459](#459)
Copy link

🎉 This issue has been resolved in version 6.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the Status: Released It's now live. label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Released It's now live. Type: Bug Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants