Skip to content

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

Open
@ziggi

Description

@ziggi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions