9router / src /lib /db /helpers /jsonCol.js
2api
feat: configurable stream stall timeout + per-provider UI
88c4c60
Raw
History Blame Contribute Delete
274 Bytes
export function parseJson(str, fallback = null) {
if (str == null) return fallback;
if (typeof str !== "string") return str;
try { return JSON.parse(str); } catch { return fallback; }
}
export function stringifyJson(value) {
return JSON.stringify(value ?? null);
}