git ssb

0+

cel-desktop / ssb-pkg



Tree: d456a6cc8589489e558e6164750474ed2cfc961e

Files: d456a6cc8589489e558e6164750474ed2cfc961e / 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