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

types: pass DocType down to subdocuments so HydratedSingleSubdocument and HydratedArraySubdocument toObject() returns correct type #14612

Merged
merged 2 commits into from
May 30, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14601

Summary

Right now toObject() on subdocs will return any if you use HydratedArraySubdocument or HydratedSingleSubdocument.

I made this PR against master, but when merged I will also cherry-pick to 7.x.

Examples

…t` and `HydratedArraySubdocument` `toObject()` returns correct type

Fix #14601
@vkarpov15 vkarpov15 added this to the 8.4.1 milestone May 24, 2024
@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label May 25, 2024
test/types/subdocuments.test.ts Outdated Show resolved Hide resolved
@vkarpov15 vkarpov15 merged commit ca09111 into master May 30, 2024
5 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-14601 branch May 30, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Breaking types of toObject on SubDocument or ArraySubdocument
2 participants