mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-21 12:48:28 +00:00
loadFromFs: fix shadowing variable name
This commit is contained in:
parent
39ae930a0c
commit
b3e07e236b
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user