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

Function scanAllTasks

apps/desktop/src/main/tasks.ts:33–39  ·  view source on GitHub ↗
(root: string)

Source from the content-addressed store, hash-verified

31 * note. Parallelized with `Promise.all` so a 500-note vault is IO-bound,
32 * not sequentially latent. */
33export async function scanAllTasks(root: string): Promise<VaultTask[]> {
34 const metas = (await listNotes(root)).filter((m) => includesFolder(m.folder))
35 const batches = await Promise.all(metas.map((m) => readOne(root, m)))
36 const out: VaultTask[] = []
37 for (const b of batches) out.push(...b)
38 return out
39}
40
41const LIVE_FOLDERS = new Set<NoteFolder>(['inbox', 'quick', 'archive'])
42

Callers 2

registerIpcFunction · 0.90
cmdTaskListFunction · 0.50

Calls 3

listNotesFunction · 0.90
includesFolderFunction · 0.85
readOneFunction · 0.85

Tested by

no test coverage detected