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

applyDiff not working if the target is undefined/null/false #163

Open
ziggi opened this issue Jul 23, 2019 · 1 comment
Open

applyDiff not working if the target is undefined/null/false #163

ziggi opened this issue Jul 23, 2019 · 1 comment

Comments

@ziggi
Copy link

ziggi commented Jul 23, 2019

applyDiff not working if the target is undefined/null/false but diff works well with the same target. So, I think applyDiff should works with target same as diff do (applyDiff should change the target or diff, should return null as difference).

https://playcode.io/366102

const lhs = false;
const rhs = {
  value: 'test',
};

const diff = DeepDiff.diff(lhs, rhs);
console.log('diff', diff);

DeepDiff.applyDiff(lhs, rhs);

console.log('After apply', lhs);

image

@rszemplinski
Copy link

+1

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

No branches or pull requests

2 participants