initial commit

This commit is contained in:
2026-02-01 15:02:15 +02:00
commit c258d16088
11 changed files with 10571 additions and 0 deletions

27
filter.ts Normal file
View File

@@ -0,0 +1,27 @@
import fs from "node:fs";
const base = "3961023";
const INPUT_FILE_NAME = `output_${base}.json`;
const OUTPUT_FILE_NAME = `mapped_output_${base}.json`;
const writeToFile = (data: object) => {
fs.writeFileSync(OUTPUT_FILE_NAME, JSON.stringify(data, undefined, 2));
};
(() => {
const existingData = fs.readFileSync(INPUT_FILE_NAME);
const existingDataMapped = JSON.parse(existingData.toString()) as [string, string][];
const formatted = existingDataMapped.reduce((acc, [idCode, value]) => ({
...acc,
...(value === "INVALID" ? {} : {
[idCode]: (() => {
const nameStartIdx = value.indexOf(": ") + 2;
const lastCommaIdx = value.lastIndexOf(",");
return value.substring(nameStartIdx, lastCommaIdx);
})(),
})
}), {});
writeToFile(formatted);
})();