Skip to content

Conversation

@hasezoey
Copy link
Collaborator

@hasezoey hasezoey commented Dec 5, 2023

Summary

This PR removes function utils.options (lib/utils.js) which shallow-copies objects, which is now solved with JS-native spread-operator.

i got this idea because of #14155.

my only concern would be the removal of clone's that was done previously (with 6820605), no tests fail and the comments mentioned it was because utils.options directly assigned to the second parameter.

as for performance, i have not measured, but i would assume it is about the same, if not better thanks to the removal of clones

@hasezoey hasezoey added the refactor This is a purely internal change for making Mongoose internals easier to understand and work with label Dec 5, 2023
it was for shallow-copying objects, which is now solved by spread-operators
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 merged commit f3ca867 into Automattic:7.x Dec 5, 2023
@hasezoey hasezoey deleted the removeUtilsOptions branch December 5, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor This is a purely internal change for making Mongoose internals easier to understand and work with

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants