add diff/diff.d.ts

This commit is contained in:
vvakame
2014-04-10 18:59:19 +09:00
parent c5d0f1532f
commit d3dd12701c
3 changed files with 72 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
/// <reference path="./diff.d.ts" />
import jsdiff = require('diff');
var one = 'beep boop';
var other = 'beep boob blah';
var diff = jsdiff.diffChars(one, other);
diff.forEach(function (part) {
var mark = part.added ? '+' :
part.removed ? '-' : ' ';
console.log(mark + " " + part.value);
});