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