(doc: Y.Doc, repoId: string)
| 203 | } |
| 204 | |
| 205 | function findRepoMap(doc: Y.Doc, repoId: string): Y.Map<unknown> | null { |
| 206 | const repos = doc.getMap<Y.Map<unknown>>("repos:data") |
| 207 | const repo = repos.get(repoId) |
| 208 | return repo instanceof Y.Map ? repo : null |
| 209 | } |
| 210 | |
| 211 | function ensureTaskPreview(repoMap: Y.Map<unknown>, preview: { id: string; slug: string; title: string; createdAt: string }, updatedAt: string): void { |
| 212 | const tasks = ensureYArray(repoMap, "tasks") |
no test coverage detected