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 toJSON to always provide copy of data (cloneDeep) #10058

Merged
merged 1 commit into from Oct 23, 2018
Merged

Fix toJSON to always provide copy of data (cloneDeep) #10058

merged 1 commit into from Oct 23, 2018

Conversation

justinkalland
Copy link
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Changes mode.toJSON() to always return a copy of the underlying data. This was a small change from lodash clone() to cloneDeep().

Closes #10052

@codecov
Copy link

codecov bot commented Oct 22, 2018

Codecov Report

Merging #10058 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #10058   +/-   ##
=======================================
  Coverage    96.3%    96.3%           
=======================================
  Files          63       63           
  Lines        9410     9410           
=======================================
  Hits         9062     9062           
  Misses        348      348
Impacted Files Coverage Δ
lib/model.js 96.67% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0545bf...a11bd4c. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 09ced4d into sequelize:master Oct 23, 2018
@sushantdhiman
Copy link
Contributor

Thanks @justinkalland

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.

model.get() does not clone objects for JSON data-type
2 participants