MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / safeGetJson

Function safeGetJson

apps/kimi-web/src/lib/storage.ts:79–87  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

77}
78
79export function safeGetJson<T>(key: string): T | null {
80 const raw = safeGetString(key);
81 if (raw === null) return null;
82 try {
83 return JSON.parse(raw) as T;
84 } catch {
85 return null;
86 }
87}
88
89export function safeSetJson(key: string, value: unknown): void {
90 try {

Callers 6

loadMapFunction · 0.90
loadCollapsedWorkspacesFunction · 0.85
loadShowWorkspacePathsFunction · 0.85
loadWorkspaceOrderFunction · 0.85

Calls 1

safeGetStringFunction · 0.85

Tested by

no test coverage detected