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

PoC for Object assign #11399

Merged
merged 1 commit into from
Feb 15, 2022
Merged

Conversation

Uzlopak
Copy link
Collaborator

@Uzlopak Uzlopak commented Feb 15, 2022

This PR is more a question. Why do we manually create an object and then assign each field from the source object to the target object, if we can do the same with Object.assign?

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.

Because Mongoose pre-dates Object.assign() by a few years, so there are places where we should use Object.assign(), but don't yet. Feel free to change to using Object.assign() instead of this sort of one-off manual replacement wherever you find it.

@vkarpov15 vkarpov15 added this to the 6.2.2 milestone Feb 15, 2022
@vkarpov15 vkarpov15 merged commit 96c067e into Automattic:master Feb 15, 2022
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.

None yet

2 participants