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: avoid BufferToBinary<> wiping lean types when passed to generic functions #15160

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

vkarpov15
Copy link
Collaborator

Fix #15158

Summary

I am not entirely certain why this fix works, mostly done by trial and error. Likely https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types.

This PR is more reason why I would like to get rid of the various BufferToBinary etc. helper types in favor of calculating various types in the schema: raw doc type, hydrated doc type, and JSON serialized doc type.

Examples

@vkarpov15 vkarpov15 added this to the 8.9.4 milestone Jan 6, 2025
@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Jan 8, 2025
@vkarpov15 vkarpov15 merged commit e56b046 into master Jan 8, 2025
5 checks passed
@hasezoey hasezoey deleted the vkarpov15/gh-15158 branch January 8, 2025 19:58
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.

Lean query converts to binary when using generic as type
2 participants