eugeneware / changeset Goto Github PK
View Code? Open in Web Editor NEWLibrary to diff JSON objects into atomic put and delete operations, and apply change sets to objects. Useful with Levelup/LevelDB object synchronization.
License: Other
Library to diff JSON objects into atomic put and delete operations, and apply change sets to objects. Useful with Levelup/LevelDB object synchronization.
License: Other
Do you think that this could be used, potentially, for diffing/patching minidom
s?
Trying, first thing I ran into was infinite recursion in compare
, due to a _documentOwner
key pointing to the parent (or grandparent, is it?).
If this is fixed, how much more issues do you assume will come up?
@eugeneware would you be happy if I introduced a PR with string diff/patching, using probably diff
?
Currently, there is an issue when diffing and patching an object where the types of a field changes from an object to a string.
That is, I would expect the following to work:
var a = {hello: {nested: 2}};
var b = {hello: 3};
var changeset = diff(a, b);
var b_ = diff.apply(changeset, a);
expect(b).to.deep.equals(b_);
However, b_
is set to {hello: {}}
following the above operations.
It would be great if deletion operations for arrays were presented in reverse order to ensure that they are deleted from the end rather than from the start. For regular JSON, the current approach is fine but the current approach is problematic when using this to edit a more complex object which does not provide the same low-level access since it might automatically shift the indices down for us.
A concrete example where this is problematic can be found here.
Hi, would you mind adding a LICENSE file to the repo? I see BSD
listed in the package.json
but I'm in the process of open sourcing some stuff out of my company that uses your module and my legal department will have issue with the license text not actually being included.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.