How to use the just-diff.diff function in just-diff

To help you get started, we’ve selected a few just-diff examples, based on popular ways it is used in public projects.

github ChromeDevTools / devtools-protocol / scripts / generate-changelog.js View on Github external
const childChanges = itemDiff.modified.forEach(change => {
        const changeName = change[itemKey];
        const before = prev.find(c => c[itemKey] === changeName)
        const after = current.find(c => c[itemKey] === changeName)
        const jd = justDiff(before, after);

        // resolve the path
        jd.forEach(jdOp => {
          // Don't need to resolve paths for 'add' because we already know the name
          if (jdOp.op === 'add') return;
          jdOp.path = this.resolvePath(jdOp.path, before);
        });

        change.childChanges = jd;
    });
    return itemDiff;

just-diff

Return an object representing the diffs between two objects. Supports jsonPatch protocol

MIT
Latest version published 2 months ago

Package Health Score

94 / 100
Full package analysis

Popular just-diff functions