MCPcopy Create free account
hub / github.com/bytebase/bytebase / safeWrite

Function safeWrite

frontend/src/react/stores/sqlEditor/tab.ts:112–119  ·  view source on GitHub ↗
(key: string, value: unknown)

Source from the content-addressed store, hash-verified

110};
111
112const safeWrite = (key: string, value: unknown) => {
113 if (typeof window === "undefined") return;
114 try {
115 window.localStorage.setItem(key, JSON.stringify(value));
116 } catch {
117 // Ignore quota / serialization errors.
118 }
119};
120
121const isPersistentTabArray = (v: unknown): v is PersistentTab[] =>
122 Array.isArray(v);

Callers 2

persistOpenTabsFunction · 0.70
persistCurrentTabIdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected