Skip to content

xwiki-labs/json-ot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON OT

var O = { x: 5, };
var A = { x: 7, };
var B = { x: 5, y: 9, };

var a = diff(O, A); // update [x] -> 7
var b = diff(O, B); // insert [y] -> 9

var changes = resolve(a, b)
/*
    [
        {
            type: 'update',
            path: ['x'],
            value: 7,
        },
        {
            type: 'insert',
            path: ['y'],
            value: 9,
        }
    ]
*/

// result
var R = OT.patch(O, changes);

/*
    {
        x: 7,
        y: 9,
    }
*/

// operation(type, path, value);

About

operational transform on json

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published