mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.198.1
This commit is contained in:
15
node/generate-subclass-lookup.js
Normal file
15
node/generate-subclass-lookup.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as 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.");
|
||||
Reference in New Issue
Block a user