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

Function readTaskMetaId

projects/electron/src/modules/code/yjsStorage.ts:90–99  ·  view source on GitHub ↗
(data: Uint8Array)

Source from the content-addressed store, hash-verified

88}
89
90function readTaskMetaId(data: Uint8Array): string | null {
91 const doc = new Y.Doc()
92 try {
93 Y.applyUpdate(doc, data)
94 const metaId = doc.getMap("task:meta").get("id")
95 return typeof metaId === "string" ? metaId : null
96 } finally {
97 doc.destroy()
98 }
99}
100
101function isExpectedTaskDoc(id: string, data: Uint8Array): boolean {
102 const expected = expectedTaskMetaId(id)

Callers 1

isExpectedTaskDocFunction · 0.70

Calls 2

destroyMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected