mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
- Add modular DB layer (adapters, migrations, repos, helpers) - Replace localDb/usageDb/requestDetailsDb monoliths with repos - Add Tailscale tunnel integration & status check API - Add /api/cli-tools/all-statuses aggregated endpoint - Add settingsStore (Zustand) and mitm/dbReader - Add DB unit tests (benchmark, concurrent, migration, vs-lowdb)
10 lines
274 B
JavaScript
10 lines
274 B
JavaScript
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);
|
|
}
|