Skip to content

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

Merged
sushantdhiman merged 1 commit into
sequelize:masterfrom
justinkalland:fix-model-get-json
Oct 23, 2018
Merged

sushantdhiman merged 1 commit into
sequelize:masterfrom
justinkalland:fix-model-get-json

Conversation

@justinkalland

Copy link
Copy Markdown
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

codecov Bot commented Oct 22, 2018 •

Copy link
Copy Markdown

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
Copy Markdown
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