loadFromFs: fix shadowing variable name

This commit is contained in:
wukko 2024-02-13 13:50:06 +06:00 committed by dumbmoron
parent 39ae930a0c
commit b3e07e236b
No known key found for this signature in database

View File

@ -7,16 +7,9 @@ const splitDir = path.dirname(fileURLToPath(import.meta.url)).split('/');
splitDir.splice(-2); splitDir.splice(-2);
const dir = splitDir.join('/'); const dir = splitDir.join('/');
export function loadJSON(path) { export function loadJSON(filePath) {
try { try {
return JSON.parse(fs.readFileSync(`${dir}/${path}`, 'utf-8')) return JSON.parse(fs.readFileSync(`${dir}/${filePath}`, 'utf-8'))
} catch(e) {
return false
}
}
export function loadFile(path) {
try {
return fs.readFileSync(path, 'utf-8')
} catch(e) { } catch(e) {
return false return false
} }