|
|
@ -5,6 +5,7 @@ define([
|
|
|
|
var JsonOT = {};
|
|
|
|
var JsonOT = {};
|
|
|
|
|
|
|
|
|
|
|
|
var validate = JsonOT.validate = function (text, toTransform, transformBy) {
|
|
|
|
var validate = JsonOT.validate = function (text, toTransform, transformBy) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
var resultOp = ChainPad.Operation.transform0(text, toTransform, transformBy);
|
|
|
|
var resultOp = ChainPad.Operation.transform0(text, toTransform, transformBy);
|
|
|
|
var text2 = ChainPad.Operation.apply(transformBy, text);
|
|
|
|
var text2 = ChainPad.Operation.apply(transformBy, text);
|
|
|
|
var text3 = ChainPad.Operation.apply(resultOp, text2);
|
|
|
|
var text3 = ChainPad.Operation.apply(resultOp, text2);
|
|
|
@ -19,6 +20,9 @@ define([
|
|
|
|
text3: text3
|
|
|
|
text3: text3
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (x) {
|
|
|
|
|
|
|
|
console.error(x);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// returning **null** breaks out of the loop
|
|
|
|
// returning **null** breaks out of the loop
|
|
|
|
// which transforms conflicting operations
|
|
|
|
// which transforms conflicting operations
|
|
|
|