remove layout stuff

This commit is contained in:
Jörg Breitbart
2026-05-18 21:15:29 +02:00
parent c0007301c1
commit 2f49f321c1
10 changed files with 0 additions and 951 deletions
-38
View File
@@ -1,38 +0,0 @@
import fs from 'node:fs';
import path from 'node:path';
const DATA = {};
for (let i = 2; i < process.argv.length; ++i) {
const filename = process.argv[i];
const key = path.basename(filename).split('.')[0];
const value = JSON.parse(fs.readFileSync(filename));
DATA[key] = value;
}
let keys = [];
for (const map in DATA) {
keys = keys.concat(Object.keys(DATA[map]));
}
const KEYS = Array.from(new Set(keys)).sort();
const ACC = Object.fromEntries(Object.keys(DATA).map((el, i) => [el, i]));
const MAP = Object.fromEntries(KEYS.map(el => [el, []]));
for (const key of KEYS) {
for (const map in ACC) {
MAP[key].push(DATA[map][key]);
}
}
// minify if all entries are of length 1
for (const key in MAP) {
for (const c of MAP[key]) {
if (!c || c.length !== 1)
break;
}
MAP[key] = MAP[key].join('');
}
const FINAL = {acc: ACC, map: MAP};
console.log(FINAL);
console.log(JSON.stringify(FINAL).length);