some helper scripts

This commit is contained in:
be5invis 2023-10-30 22:06:26 -07:00
parent 79a2fafdb4
commit 183b02d652
2 changed files with 20 additions and 2 deletions

View file

@ -140,10 +140,10 @@ function uniqueHotChars(cfgDefault, cfgSS) {
}
return Array.from(s);
}
export async function parseVariantsData() {
export async function parseVariantsData(fileName) {
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
const variantsToml = await fs.promises.readFile(
path.join(__dirname, "../../params/variants.toml"),
path.join(__dirname, "../../params/", fileName || "variants.toml"),
"utf8"
);
const varDatRaw = toml.parse(variantsToml);