Update r function

This commit is contained in:
memetrollsXD 2022-08-04 10:58:33 +02:00
parent 4d4fb3d6e3
commit 7577f0e273
No known key found for this signature in database
GPG Key ID: 105C2F3417AC32CD

View File

@ -12,7 +12,7 @@ type Banner = {
} }
function r(...args: string[]) { function r(...args: string[]) {
return fs.readFileSync(resolve(__dirname, ...args)).toString(); return resolve(__dirname, ...args);
} }
export default class Banners { export default class Banners {
@ -39,7 +39,7 @@ export default class Banners {
]; ];
try { try {
config = JSON.parse(r('../../banners.json')); config = JSON.parse(fs.readFileSync(r('../../banners.json')).toString());
for(const [index, gachaBanner] of Object.entries(config)){ for(const [index, gachaBanner] of Object.entries(config)){
const missing = Object.keys(defaultConfig[0]).filter(key => !gachaBanner.hasOwnProperty(key)); const missing = Object.keys(defaultConfig[0]).filter(key => !gachaBanner.hasOwnProperty(key));