diff --git a/api/modules/util/loadFromFs.js b/api/modules/util/loadFromFs.js index 813522b3..17273737 100644 --- a/api/modules/util/loadFromFs.js +++ b/api/modules/util/loadFromFs.js @@ -7,16 +7,9 @@ const splitDir = path.dirname(fileURLToPath(import.meta.url)).split('/'); splitDir.splice(-2); const dir = splitDir.join('/'); -export function loadJSON(path) { +export function loadJSON(filePath) { try { - return JSON.parse(fs.readFileSync(`${dir}/${path}`, 'utf-8')) - } catch(e) { - return false - } -} -export function loadFile(path) { - try { - return fs.readFileSync(path, 'utf-8') + return JSON.parse(fs.readFileSync(`${dir}/${filePath}`, 'utf-8')) } catch(e) { return false }