MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / readMapObject

Function readMapObject

projects/openade-module/src/nodeYjsStorage.ts:226–235  ·  view source on GitHub ↗
(documentId, mapName)

Source from the content-addressed store, hash-verified

224 return data ? { id, data: Buffer.from(data).toString("base64") } : null
225 },
226 async readMapObject(documentId, mapName) {
227 const doc = await loadDoc(documentId)
228 if (!doc) return null
229 try {
230 const value = toPlain(doc.getMap(mapName))
231 return isRecord(value) ? value : {}
232 } finally {
233 doc.destroy()
234 }
235 },
236 async readOrderedArray<T extends Record<string, unknown>>(documentId: string, name: string): Promise<T[] | null> {
237 const doc = await loadDoc(documentId)
238 if (!doc) return null

Callers

nothing calls this directly

Calls 4

destroyMethod · 0.80
loadDocFunction · 0.70
toPlainFunction · 0.70
isRecordFunction · 0.70

Tested by

no test coverage detected