MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / snapshotNoteMetaCache

Function snapshotNoteMetaCache

apps/desktop/src/main/vault.ts:1794–1817  ·  view source on GitHub ↗
(root: string, metas: NoteMeta[])

Source from the content-addressed store, hash-verified

1792}
1793
1794function 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
1819async function persistNoteMetaCacheSnapshot(
1820 root: string,

Callers 1

Calls 2

noteMetaCacheKeyFunction · 0.85
resolveSafeFunction · 0.70

Tested by

no test coverage detected