Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit b88c91d

Browse files
committed
Added support for [diff_match_patch-style](http://code.google.com/p/google-diff-match-patch/wiki/API) output
1 parent dd580dc commit b88c91d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

diff.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,15 @@ var JsDiff = (function() {
279279
}
280280
return ret.join("");
281281
}
282+
283+
convertChangesToDMP: function(changes){
284+
var ret = [], change;
285+
for ( var i = 0; i < changes.length; i++) {
286+
change = changes[i];
287+
ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]);
288+
}
289+
return ret;
290+
}
282291
};
283292
})();
284293

0 commit comments

Comments
 (0)