changesets
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,0 +0,0 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ var Changeset = require('./Changeset') |
@@ -75,7 +75,7 @@ /*! | ||
op = this[i] | ||
if(op.length+pos > start) { | ||
if(op.input+pos >= start) { | ||
if(op.input) { | ||
if(op.length != Infinity) oplen = op.length -Math.max(0, start-pos) -Math.max(0, (op.length+pos)-(start+len)) | ||
else oplen = len | ||
range.push( op.derive(oplen) ) // (Don't copy over more than len param allows) | ||
if (oplen !== 0) range.push( op.derive(oplen) ) // (Don't copy over more than len param allows) | ||
} | ||
@@ -240,4 +240,4 @@ else { | ||
var nextOp = this.subrange(transformation.pos, Infinity)[0] // next op of this cs | ||
if(nextOp && !nextOp.input && !op.input && left) { // two inserts tied; left breaks it | ||
transformation.writeOutput(transformation.readInput(nextOp.length)) | ||
if(nextOp && !nextOp.input && !op.input) { // two inserts tied; left breaks it | ||
if (left) transformation.writeOutput(transformation.readInput(nextOp.length)) | ||
} | ||
@@ -244,0 +244,0 @@ op.apply(transformation) |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ /*! |
@@ -0,0 +0,0 @@ function Operator() { |
@@ -0,0 +0,0 @@ /*! |
{ | ||
"name": "changesets", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Changeset library incorporating an operational transformation (OT) algorithm - for node and the browser, with shareJS support", | ||
@@ -26,11 +26,10 @@ "repository": { | ||
}, | ||
"dependencies": { | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"diff_match_patch": "*", | ||
"vows": "*" | ||
"vows": "0.7.x" | ||
}, | ||
"author": "Marcel Klehr <mklehr@gmx.net>", | ||
"license": [{"type": "MIT", "url": "http://opensource.org/licenses/MIT"}], | ||
"license": "MIT", | ||
"readmeFilename": "README.md" | ||
} |
@@ -0,0 +0,0 @@ # changesets [![Build Status](https://travis-ci.org/marcelklehr/changesets.png?branch=master)](https://travis-ci.org/marcelklehr/changesets) |
@@ -244,2 +244,19 @@ /*! | ||
suite.addBatch({ | ||
'mixed (insert, retain, delete)': | ||
{ topic: function() { | ||
return ["Hello adventurer!", | ||
constructChangeset("Hello adventurer!", "Hello treasured adventurer!") | ||
, constructChangeset("Hello adventurer!", "Good day adventurers, y'all!") | ||
] | ||
} | ||
, 'should cause the same outcome ragardless of the transformation order': function(er, cs) { | ||
var text1 = cs[1].transformAgainst(cs[2], /*left:*/true).apply( cs[2].apply(cs[0]) ) | ||
var text2 = cs[2].transformAgainst(cs[1], /*left:*/false).apply( cs[1].apply(cs[0]) ) | ||
console.log(text1, text2) | ||
assert.equal(text1, text2) | ||
} | ||
} | ||
}) | ||
suite.addBatch({ | ||
'accessories': | ||
@@ -264,3 +281,3 @@ { topic: function() { | ||
returnthis.callback() | ||
return this.callback() | ||
} | ||
@@ -270,3 +287,2 @@ , 'should error if you apply the same cs twice, without transforming it': function(er) { | ||
console.log(er) | ||
assert.throws(er) | ||
} | ||
@@ -273,0 +289,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
235954
20
2066