lawsynth/apps/studio/examples/settings.example.ts
2026-08-16 23:40:41 +03:00

8 lines
402 B
TypeScript

import { DEFAULT_SETTINGS, mergeSettings, parseSettings } from "../src/settings.js";
/** Restore persisted settings, then apply an explicit operator-selected endpoint. */
export function restoreSettings(serialized: string | undefined, apiBaseUrl: string) {
const restored = serialized === undefined ? DEFAULT_SETTINGS : parseSettings(serialized);
return mergeSettings(restored, { apiBaseUrl });
}