forked from OpenSourceLAN/better-srcds-log-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.ts
More file actions
27 lines (21 loc) · 611 Bytes
/
test.ts
File metadata and controls
27 lines (21 loc) · 611 Bytes
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
import fs = require('fs');
var process = require("process");
import lp = require("./index");
var fileContents = fs.readFileSync(process.argv[2]).toString().split("\n");
var parser = new lp.SrcdsLogParser();
var seenTypes: any = {};
for (var i = 1000; i < Math.min(50000, fileContents.length); i++) {
// try {
let o = parser.parseLine(fileContents[i]);
// if (o.Type == "Unknown" ) {
// console.log(o);
// }
if (!seenTypes[o.Type]) {
seenTypes[o.Type] = o;
}
// } catch (e) {
// console.log("error:", fileContents[i]);
// console.log(e);
// }
}
console.log(JSON.stringify(seenTypes, null, 4));