jiff

JSON Patch and diff based on rfc6902

Showing:

18 Versions

0.7.3

  • Make diffing arrays of arrays generate smaller patches by default.
    • Previously, diffing arrays of arrays could generate larger than expected patches because the array identity was used as the hash function. It now uses JSON.stringify by default, as is done for arrays of objects. The hash can still be overridden when calling jiff.diff--this just makes the default more sane.

0.7.2

  • Fix for case where a property value is changed from an array to an object or vice versa. Patch will now correctly contain a replace operation.

0.7.1

  • Add invertible option to jiff.diff to suppress extra test ops. This makes for smaller patches, but means patches cannot be inverted using jiff.inverse

0.7.0

  • Improve jiff.clone performance 3x or more
  • Removed jiff.clone custom Date reviving
    • This may be a breaking change if you relied on this behavior. However, we feel this hidden behavior caused more issues than it helped. Date deserialization is now the responsibility of the caller who parsed the JSON string from which the original object/array/etc. (ie, the one passed to jiff.clone) was created.

0.6.0

0.5.6

  • Optimize JSON Pointer decoding/parsing for across-the-board perf improvements.
  • Switch to loops instead of Array.prototype.* in several perf-critical spots.
  • Make copy operations throw InvalidPatchOperationError for non-existent from paths.

0.5.5

  • Handle whole JSON document test operations, when path is '' as per rfc6901
  • Fix null handling in deepEquals

0.5.4

  • Fixes for commutation and rebasing

0.5.3

  • Experimental patch rebasing.

0.5.2

  • Fix version numbers

0.5.1

  • Fix for rare off-by-1 error in array diffing

0.5.0

  • Patch inversion
  • Experimental Patch commutation. Only works for array paths in this release, but will be extended to support object paths in a future release.

0.4.2

  • Fix default hash function
  • Fix README typo

0.4.1

  • Generate numeric index instead of "/-" when appending to arrays. It's allowed by the RFC and avoids an extra comparison.

0.4.0

0.3.0

  • Supports move, copy, and test operations.
  • Throws appropriate errors for invalid patch operations and test failures
  • Correctly handles array paths ending in "/-"

0.2.0

0.1.0

  • JSON Patch support for add, replace, and remove operations
  • Diff for objects, arrays, and values that produces rfc6902-compliant patches