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

Function filterNotes

integrations/raycast/src/search-notes.tsx:376–386  ·  view source on GitHub ↗
(notes: ZenNote[], filter: FilterValue)

Source from the content-addressed store, hash-verified

374}
375
376function filterNotes(notes: ZenNote[], filter: FilterValue): ZenNote[] {
377 if (filter === "all") return notes;
378 if (filter.startsWith("folder:")) {
379 const folder = filter.slice("folder:".length) as NoteFolder;
380 return notes.filter((note) => note.folder === folder);
381 }
382 const tag = filter.slice("tag:".length).toLowerCase();
383 return notes.filter((note) =>
384 note.tags.some((candidate) => candidate.toLowerCase() === tag),
385 );
386}
387
388function collectTags(notes: ZenNote[]): string[] {
389 const tags = new Map<string, string>();

Callers 1

SearchNotesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected