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: make Buffers into mongodb.Binary in lean result type to match runtime behavior #14967

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

vkarpov15
Copy link
Collaborator

Fix #14902

Summary

#14902 points out correctly that lean() returns buffers as instances of mongodb.Binary at runtime, but our types say buffers are of type Buffer. This PR changes Mongoose's TypeScript types to match the runtime behavior.

Examples

@vkarpov15 vkarpov15 added this to the 8.7.2 milestone Oct 16, 2024
@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Oct 17, 2024
@vkarpov15 vkarpov15 merged commit de211db into master Oct 17, 2024
5 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-14902 branch October 17, 2024 15:00
@richardsimko
Copy link

This seems to be causing #14974. Any chance it can be rolled back since the new types are a breaking change?

david-loe added a commit to david-loe/abrechnung that referenced this pull request Oct 29, 2024
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.

Invalid type for Buffer
3 participants