Unjank
This commit is contained in:
parent
0e70a0d57a
commit
96ff85ab80
|
@ -27,11 +27,7 @@ export function checkFile(
|
|||
if (fs.existsSync(file)) {
|
||||
const data = fs.readFileSync(file, encoding);
|
||||
|
||||
final =
|
||||
data.toString().trim() === ""
|
||||
? generic
|
||||
: // @ts-ignore
|
||||
JSON.parse(data);
|
||||
final = !data.toString().trim() ? generic : JSON.parse(data.toString());
|
||||
} else {
|
||||
fs.createWriteStream(file);
|
||||
final = generic;
|
||||
|
|
Loading…
Reference in a new issue