najmam / custom-json-diff

In: two JS objects. Out: an array of operations (add/remove/replace/keep) along with the old/new values.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a modification upon rfc6902-json-diff that doesn't satisfy RFC6902.

Changes :

  • for leaf operations
    • upon an add or replace operation, retain the new value in a newValue property
    • upon a remove or replace operation, retain the new value in an oldValue property
    • if values of a field referred to by an identical path are equal (according to lodash.isEqual) across the compared objects, this is considered as a keep operation. Both newValue and oldValue are defined
  • no change for non-leaf nodes

About

In: two JS objects. Out: an array of operations (add/remove/replace/keep) along with the old/new values.

License:MIT License


Languages

Language:JavaScript 100.0%