mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-29 01:48:28 +00:00
loadFromFs: clean up
This commit is contained in:
parent
98e05368ed
commit
c2678888be
@ -3,14 +3,14 @@ import * as fs from "fs";
|
|||||||
export function loadJSON(path) {
|
export function loadJSON(path) {
|
||||||
try {
|
try {
|
||||||
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
return JSON.parse(fs.readFileSync(path, 'utf-8'))
|
||||||
} catch(e) {
|
} catch {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export function loadFile(path) {
|
export function loadFile(path) {
|
||||||
try {
|
try {
|
||||||
return fs.readFileSync(path, 'utf-8')
|
return fs.readFileSync(path, 'utf-8')
|
||||||
} catch(e) {
|
} catch {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user