aogriffiths / jsondiff-js

A JavaScript implementation to create json patches of the JSON Media Type for partial modifications: http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-08. See also https://github.com/bruth/jsonpatch-js.
https://github.com/aogriffiths/jsondiff-js
BSD 2-Clause "Simplified" License
23 stars 11 forks source link

Adding lists is broken #7

Open andreas-gruenbacher opened 10 years ago

andreas-gruenbacher commented 10 years ago

jsondiff.diff([null], [[1]]) should result in: [{"op":"add","path":"/0","value":[1]}]

But it actually results in: [{"op":"add","path":"/0/0","value":1},{"op":"replace","path":"/0","value":[1]}]

andreas-gruenbacher commented 10 years ago

Note that I've stopped trying to make this project work for me after looking at the code a bit more closely; I've rewritten it instead.