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

Function readNoteComments

apps/desktop/src/main/vault.ts:2716–2727  ·  view source on GitHub ↗
(root: string, rel: string)

Source from the content-addressed store, hash-verified

2714}
2715
2716export async function readNoteComments(root: string, rel: string): Promise<NoteComment[]> {
2717 const notePath = toPosix(rel)
2718 const abs = noteCommentsPath(root, notePath)
2719 try {
2720 const raw = await fs.readFile(abs, 'utf8')
2721 return normalizeNoteComments(JSON.parse(raw), notePath)
2722 } catch (err) {
2723 if ((err as NodeJS.ErrnoException).code === 'ENOENT') return []
2724 if (err instanceof SyntaxError) return []
2725 throw err
2726 }
2727}
2728
2729export async function writeNoteComments(
2730 root: string,

Callers 3

registerIpcFunction · 0.90
moveNoteCommentsFunction · 0.70
copyNoteCommentsFunction · 0.70

Calls 3

noteCommentsPathFunction · 0.85
normalizeNoteCommentsFunction · 0.85
toPosixFunction · 0.70

Tested by

no test coverage detected