api9nin / src /lib /db /helpers /jsonCol.js
github-actions[bot]
deploy from github actions 2026-06-18
c8ae75d
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);
}