How to use just-diff - 1 common examples

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 years ago

Package Health Score

77 / 100
Full package analysis

Popular just-diff functions