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

fix(types): make array paths optional in inferred type of array default returns undefined #12649

Merged
merged 2 commits into from Nov 2, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12420

Summary

Our types should treat setting default to a function that always returns undefined in the same way we treat setting default: undefined.

Examples

Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

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

LGTM

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Nov 2, 2022
Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

is there already a types-test for default: undefined? if not, maybe one should also be added in addition to default: () => undefined

@vkarpov15 vkarpov15 merged commit 64f6ff4 into master Nov 2, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12420 branch November 2, 2022 16:43
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.

mongoose.InferSchemaType does not correctly infer nullable arrays
3 participants