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

Function parseNoteList

integrations/raycast/src/lib/zen.ts:75–81  ·  view source on GitHub ↗
(stdout: string)

Source from the content-addressed store, hash-verified

73}
74
75export function parseNoteList(stdout: string): ZenNote[] {
76 const parsed = JSON.parse(stdout) as unknown;
77 if (!Array.isArray(parsed)) {
78 throw new Error("Expected `zn list --json` to return an array of notes.");
79 }
80 return parsed.map(parseNote).filter((note): note is ZenNote => note !== null);
81}
82
83export function parseNote(value: unknown): ZenNote | null {
84 if (!isRecord(value)) return null;

Callers 1

loadNotesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected