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

Address some issues where spread operator was used but deep copy needed #10803

Merged
merged 4 commits into from
Apr 11, 2023

Conversation

Colengms
Copy link
Contributor

The spread operator only copies 1 level deep. Any objects or arrays the source object will be 'referenced' by the new object, not copied.

Updated existing uses of the spread operator where it looks like a deep copy was intended.

Uses the module lodash for its cloneDeep function. But we could roll our own instead, if that would be preferable.

@sean-mcmanus sean-mcmanus merged commit 8bf5d6e into main Apr 11, 2023
@sean-mcmanus sean-mcmanus deleted the coleng/deep_copies branch April 11, 2023 22:12
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants