mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
16 lines
617 B
JavaScript
16 lines
617 B
JavaScript
import fs from "fs";
|
|
import "../js/parser.js";
|
|
import "../js/utils.js";
|
|
|
|
const out = {};
|
|
const classIndex = JSON.parse(fs.readFileSync("./data/class/index.json", "utf-8"));
|
|
Object.values(classIndex).forEach(f => {
|
|
const data = JSON.parse(fs.readFileSync(`./data/class/${f}`, "utf-8"));
|
|
|
|
(data.subclass || []).forEach(sc => {
|
|
MiscUtil.set(out, sc.classSource, sc.className, sc.source, sc.shortName, {name: sc.name, isReprinted: sc.isReprinted});
|
|
});
|
|
});
|
|
fs.writeFileSync(`./data/generated/gendata-subclass-lookup.json`, CleanUtil.getCleanJson(out, {isMinify: true}));
|
|
console.log("Regenerated subclass lookup.");
|