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(schematypes): add property "defaultOptions" #12818

Merged
merged 1 commit into from Dec 20, 2022

Conversation

hasezoey
Copy link
Collaborator

Summary

This PR adds the property defaultOptions for SchemaType and its extending classes
for SchemaType itself, property defaultOptions is optional, see: (and also search through the file, there is no explicit assignment)

const defaultOptions = this.constructor.defaultOptions || {};

but all mongoose provided extending classes explicitly define it:

SubdocumentPath.defaultOptions = {};

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Dec 20, 2022
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, thanks! 👍

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@vkarpov15 vkarpov15 added this to the 6.8.2 milestone Dec 20, 2022
@vkarpov15 vkarpov15 merged commit dcf731a into Automattic:master Dec 20, 2022
@hasezoey hasezoey deleted the addDefaultOptionsST branch December 21, 2022 11:01
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.

None yet

3 participants