mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-10 05:54:52 +00:00
simplify and unify entity management
This commit is contained in:
parent
dbff4e9fe3
commit
b6975da8ed
135 changed files with 2535 additions and 1545 deletions
39
scripts/filter-chrome-logs.ts
Normal file
39
scripts/filter-chrome-logs.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { createReadStream, createWriteStream } from "node:fs";
|
||||
import * as readline from "node:readline";
|
||||
import { parseArgs } from "node:util";
|
||||
|
||||
process.stdout.on("error", (err: NodeJS.ErrnoException) => {
|
||||
if (err.code === "EPIPE") process.exit(0);
|
||||
throw err;
|
||||
});
|
||||
|
||||
const { values, positionals } = parseArgs({
|
||||
options: {
|
||||
output: { type: "boolean", short: "o", default: false },
|
||||
},
|
||||
allowPositionals: true,
|
||||
});
|
||||
|
||||
const inputFile = positionals[0];
|
||||
|
||||
const input = inputFile
|
||||
? createReadStream(inputFile)
|
||||
: createReadStream("/dev/stdin");
|
||||
const output =
|
||||
values.output && inputFile
|
||||
? createWriteStream(inputFile.replace(/\.log$/, ".filtered.log"))
|
||||
: process.stdout;
|
||||
|
||||
const rl = readline.createInterface({ input });
|
||||
|
||||
for await (const line of rl) {
|
||||
const sub = line
|
||||
.replace(/^(installHook\.js:1 )/, "")
|
||||
.replace(/^eval @ unknown$/, "")
|
||||
.replace(/^([\w.[\]()-]+ @ [\w.@?=…-]+:\d+)$/, "")
|
||||
.replace(/^( ?THREE\.WebGLRenderer: Texture marked for update .*)$/, "")
|
||||
.replace(/^(requestAnimationFrame)$/, "");
|
||||
if (sub) {
|
||||
output.write(sub + "\n");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue