MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / decode

Function decode

graph-ui/src/settings/view-preferences.ts:42–50  ·  view source on GitHub ↗
(raw: string | null)

Source from the content-addressed store, hash-verified

40}
41
42function decode(raw: string | null): Readonly<ViewPreferences> {
43 try {
44 const record: unknown = JSON.parse(raw ?? 'null');
45 if (record && typeof record === 'object' && 'version' in record && record.version === 1 && 'preferences' in record) {
46 return validated(record.preferences);
47 }
48 } catch { /* Invalid storage is equivalent to no saved preference. */ }
49 return DEFAULT_VIEW_PREFERENCES;
50}
51
52/** Stable snapshots prevent a settings change from remounting or resetting either scene. */
53export function readViewPreferences(project: string): Readonly<ViewPreferences> {

Callers 1

readViewPreferencesFunction · 0.70

Calls 1

validatedFunction · 0.70

Tested by

no test coverage detected