-
Notifications
You must be signed in to change notification settings - Fork 1
/
genReport.js
56 lines (53 loc) · 1.35 KB
/
genReport.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const fs = require('fs');
const args = process.argv.slice(2);
const collecion = args[0] ? args[0] : "topCollection200";
const testReport = require(`./${collecion}-withtest.json`);
const summaryBlock = `
# ${collecion}
- collections: ${testReport.length}
`;
const detailBlock = testReport
.map((_) => {
_.above = _.ks_test_result
.map((_) => {
_.min = _.score.split("-")[1];
_.min = _.min ? parseInt(_.min) : null;
return _;
});
return _;
})
.filter((_) => _.above.length)
.map((_) => {
return {
name: _.name,
above: _.above,
ks_test_result: JSON.stringify(_.ks_test_result),
opensea: `https://opensea.io/collection/${_.slug}`,
};
})
.map((_) => {
return [
`## ${_.name}`,
`[opensea](${_.opensea})`,
_.above
.map((_) => {
return [
`### ${_.account}`,
`- [opensea](https://opensea.io/${_.account})`,
`- score: ${_.score}`,
`- num_minted: ${_.num_minted}`,
`- num_transactions: ${_.num_transactions}`,
"``` json",
JSON.stringify(_.lowest_list),
"```",
"\n",
].join("\n");
})
.join("\n"),
].join("\n");
})
.join("\n");
fs.writeFileSync(
`./reports/${collecion}.md`,
[summaryBlock, detailBlock].join("\n")
);