git ssb

0+

cel-desktop / ssb-pkg



Tree: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44

Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-79-npm / diff / diff.js

404 bytesRaw
1'use strict';
2
3var jsdiff = require('diff');
4var one = 'beep boop';
5var other = 'beep boob blah';
6var diff = jsdiff.diffChars(one, other);
7var join = '';
8
9diff.forEach(function (part) {
10 var color = 'grey';
11 if (part.added) color = 'green';
12 if (part.removed) color = 'red';
13 join += color + ':[' + part.value + ']';
14});
15
16if (join === 'grey:[beep boo]red:[p]green:[b blah]') {
17 console.log('ok');
18}
19

Built with git-ssb-web