MCPcopy Create free account
hub / github.com/bigcode-project/jupytercoder / convertChangesToDMP

Function convertChangesToDMP

src/diff.js:1512–1532  ·  view source on GitHub ↗
(changes)

Source from the content-addressed store, hash-verified

1510
1511 // See: http://code.google.com/p/google-diff-match-patch/wiki/API
1512 function convertChangesToDMP(changes) {
1513 var ret = [],
1514 change,
1515 operation;
1516
1517 for (var i = 0; i < changes.length; i++) {
1518 change = changes[i];
1519
1520 if (change.added) {
1521 operation = 1;
1522 } else if (change.removed) {
1523 operation = -1;
1524 } else {
1525 operation = 0;
1526 }
1527
1528 ret.push([operation, change.value]);
1529 }
1530
1531 return ret;
1532 }
1533
1534 function convertChangesToXML(changes) {
1535 var ret = [];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected