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 type inference logic resilient to no Buffer type due to missing @types/node #15261

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

vkarpov15
Copy link
Collaborator

Fix #15121

Summary

#15121 points out an unpleasant edge case where our lean type inference breaks completely if @types/node isn't installed, because Buffer === any. Not something we can write tests for unfortunately. But this PR should make Mongoose more resilient to that case, I replaced all extends Buffer checks and we don't have any : Buffer or ?: Buffer params or properties.

Examples

@vkarpov15 vkarpov15 added this to the 8.10.2 milestone Feb 17, 2025
Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@vkarpov15 vkarpov15 merged commit 987f1ad into master Feb 18, 2025
6 checks passed
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-15121-3 branch February 18, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to write a generic function to resolve PopulatedDoc type variables?
3 participants