24 lines
520 B
TypeScript
24 lines
520 B
TypeScript
import { $ } from "bun";
|
|
import * as fs from "fs/promises";
|
|
|
|
const realdumps: number[][] | string[] = []
|
|
|
|
const dumps = realdumps.map(
|
|
(z) =>{
|
|
if(Array.isArray(z)) {
|
|
return new Uint8Array(z);
|
|
}
|
|
if(z.includes(",")) {
|
|
return new Uint8Array(z.split(",").map(z=>+z))
|
|
} else {
|
|
return Buffer.from(z, "base64");
|
|
}
|
|
}
|
|
);
|
|
|
|
for await (const dump of dumps) {
|
|
await fs.writeFile("dump", new Uint8Array(dump.buffer));
|
|
const info = await $`~/.local/bin/protobuf_inspector < dump`;
|
|
|
|
}
|
|
|