Releases: caohanyang/json_diff_rfc6902
Modify HashObject
Modify hashObject
Add options.HASH_ID
For example, if options.HASH_ID = "title", it will get the property value "title" of the elements in the array, and use them as the hash value to execute the operations transformation algorithem.
Improve speed: use id || _id || title as hash value
In order to match the objects in the array.
Use the id || _id || title as the hash value, if they have not been found, use the default hash method.
Improve the speed and generate smaller patch.
Find minimal change for elements in the array
Use the operational transformation to handle array.
When meet "replace" operation, go deeper (to the internal node) to find minimal change and yield small patch.
Use operation transformation
Use operation transformation to handle array, instead of LCS.
Change Hash array method to speed up
Hash array method:
From: JSON.stringnify()
To: require('string-hash') https://github.com/darkskyapp/string-hash
Hash array
Hash array elements for comparison.
Remove logs
Fix bugs and remove logs
First release
JSON-Diff
JSON-Diff is to diff two JSON object and generate the patch, which is compliant to JSON Patch RFC6902.
You can use JSON-Diff to
- diff two JSON object
- apply patches to get JSON
JSON-Diff is able to handle operations:
Object
- add
- remove
- replace
- copy
- move
Array
- add
- remove
- replace
- copy
- move
- permutation