MCPcopy
hub / github.com/codedogQBY/ReadAny / getJSON

Method getJSON

packages/core/src/sync/lan-server.ts:153–158  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

151 }
152
153 async getJSON<T>(path: string): Promise<T | null> {
154 try {
155 const data = await this.get(path);
156 return JSON.parse(new TextDecoder().decode(data)) as T;
157 } catch { return null; }
158 }
159
160 async putJSON<T>(path: string, data: T): Promise<void> {
161 await this.put(path, new TextEncoder().encode(JSON.stringify(data)));

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected