(root: string, metas: NoteMeta[])
| 1792 | } |
| 1793 | |
| 1794 | function snapshotNoteMetaCache(root: string, metas: NoteMeta[]): Array<{ |
| 1795 | path: string |
| 1796 | mtimeMs: number |
| 1797 | size: number |
| 1798 | meta: NoteMeta |
| 1799 | }> { |
| 1800 | const entries: Array<{ path: string; mtimeMs: number; size: number; meta: NoteMeta }> = [] |
| 1801 | for (const meta of metas) { |
| 1802 | try { |
| 1803 | const abs = resolveSafe(root, meta.path) |
| 1804 | const cached = noteMetaCache.get(noteMetaCacheKey(root, abs)) |
| 1805 | if (!cached) continue |
| 1806 | entries.push({ |
| 1807 | path: meta.path, |
| 1808 | mtimeMs: cached.mtimeMs, |
| 1809 | size: cached.size, |
| 1810 | meta: { ...cached.meta, siblingOrder: meta.siblingOrder } |
| 1811 | }) |
| 1812 | } catch { |
| 1813 | /* ignore invalid paths */ |
| 1814 | } |
| 1815 | } |
| 1816 | return entries |
| 1817 | } |
| 1818 | |
| 1819 | async function persistNoteMetaCacheSnapshot( |
| 1820 | root: string, |
no test coverage detected