Skip to content

otjs/ot-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ot-client

=======

A line-based implementation of Operational Transform in JavaScript

Build Status Dependency Status

Install

npm install ot-client

Usage

var diff = require('..').diff;
var expect = require('chai').expect;

describe('diff', function() {
  it('should return correct result', function() {
    tests.forEach(function(item) {
      expect(diff(item[0], item[1])).to.eql(item[2]);
    });
  });
});

var tests = [
  [
    [0, 1, 2, 3],
    [1, 2],
    [
      { type: 'del', line: 3 },
      { type: 'del', line: 0 }
    ]
  ],
  [
    [0, 1, 2, 3],
    [1, 1, 2, 3],
    [
      { type: 'del', line: 0 },
      { type: 'add', line: 0, text: 1 }
    ]
  ]
];

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published