Skip to content

diff calculated wrong #3

Open
Open
@nebulaszlonemethi

Description

In the simple example, a weird "copy" patch is calculated as a diff what is wrong. Check it on codepen or here:

var a = {
  choices: [
    {id: "2"}
  ]
};
var b = {
  choices: [
    {id: "2"}
  ],
  description: "2"
};

var diff = jdr.diff(a, b);
jdr.apply(a, diff, {OBJ_COM:false});

console.info("diff:", diff); // results [{op: "copy", path: "/description", from: "/choices/0"}]
console.info("this should be b:", a); // results something else than b

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions