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

never Returned when Only Optional Properties Present #476

Closed
joealden opened this issue May 20, 2024 · 4 comments · Fixed by #477
Closed

never Returned when Only Optional Properties Present #476

joealden opened this issue May 20, 2024 · 4 comments · Fixed by #477
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 20, 2024

Bug Report

Follow up from #459 - that bug has been resolved (thanks!), but now some other code is throwing errors on 7.0.0 compared to 5.1.0, where never is the resulting type. From trying to reduce it down to a minimum reproducible example, it looks like it might be something to do with optional properties.

Expected behavior

const foo: { test?: string } = { test: "" };
const bar: { test?: string } = { test: "" };
const result = deepmerge(foo, bar);
//         ^? result: { test?: string }

Actual behavior

const foo: { test?: string } = { test: "" };
const bar: { test?: string } = { test: "" };
const result = deepmerge(foo, bar);
//         ^? result: never
@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 20, 2024
@RebeccaStevens RebeccaStevens removed the Status: Triage This issue needs to be triaged. label May 20, 2024
@RebeccaStevens
Copy link
Owner

The issue seems to happen only when all properties are optional.

@RebeccaStevens RebeccaStevens changed the title never Returned when Optional Properties Present never Returned when Only Optional Properties Present May 21, 2024
RebeccaStevens added a commit that referenced this issue May 21, 2024
RebeccaStevens added a commit that referenced this issue May 21, 2024
RebeccaStevens added a commit that referenced this issue May 21, 2024
github-actions bot pushed a commit that referenced this issue May 21, 2024
## [7.0.1](v7.0.0...v7.0.1) (2024-05-21)

### Bug Fixes

* handling of partial types ([1832bd0](1832bd0)), closes [#476](#476)
Copy link

🎉 This issue has been resolved in version 7.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 21, 2024
@RebeccaStevens
Copy link
Owner

Should be fixed now. let me know if there's any other issues that pop up.

@joealden
Copy link
Author

Looks good, no more type errors in our codebase now - thanks!

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