(root: string, rel: string)
| 2714 | } |
| 2715 | |
| 2716 | export 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 | |
| 2729 | export async function writeNoteComments( |
| 2730 | root: string, |
no test coverage detected