-
Notifications
You must be signed in to change notification settings - Fork 0
/
abc.js
42 lines (33 loc) · 817 Bytes
/
abc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var csv = require('csv');
var generate = require('csv').generate;
var data = [];
var generator = generate({seed:1, columns:2, length:2, objectMode: true});
var diff = require("fast-array-diff");
generator.on('readable', function() {
while(d = generator.read()) {
data.push(d);
}
});
generator.on('error', function(err) {
console.log(err);
});
generator.on('end', function() {
// data.should.eql([ [ 'OMH', 'ONKCHhJmjadoA' ],[ 'D', 'GeACHiN' ] ]);
// console.log(data);
});
var a1 = [
[1,2,3],
[4,5,6],
];
var a2 = [
[1,2],
[4,6],
];
var a = diff.diff(a1,a2);
// console.log(a);
var es = diff.getPatch(a1, a2);
console.log(es);
// generate({seed:5, columns:2, length:100 }, function(err, output) {
// console.log(output);
// output.should.eql('OMH,ONKCHhJmjadoA\nD,GeACHiN');
// });