Fix settings button on library view
Template tests / tests (push) Failing after 46s

This commit is contained in:
Iisyourdad
2026-06-11 10:47:32 -05:00
parent a5d0013c3a
commit 572b66650b
3 changed files with 39 additions and 2 deletions
+4 -2
View File
@@ -32,7 +32,9 @@ function atomicWriteFileSync(file, data) {
}
function writeJsonSync(file, obj) {
atomicWriteFileSync(file, JSON.stringify(obj, null, 2) + '\n');
const json = JSON.stringify(obj, null, 2);
if (json === undefined) throw new TypeError(`writeJsonSync: value for ${file} is not JSON-serializable`);
atomicWriteFileSync(file, json + '\n');
}
function readJsonSync(file) {
@@ -43,7 +45,7 @@ function readJsonIfExists(file, fallback) {
try {
return readJsonSync(file);
} catch (err) {
if (err.code === 'ENOENT') return fallback;
if (err.code === 'ENOENT' || err instanceof SyntaxError) return fallback;
throw err;
}
}