(root: string, sourceRel: string, nextRel: string)
| 2772 | } |
| 2773 | |
| 2774 | async function copyNoteComments(root: string, sourceRel: string, nextRel: string): Promise<void> { |
| 2775 | const source = await readNoteComments(root, sourceRel) |
| 2776 | if (source.length === 0) return |
| 2777 | const now = Date.now() |
| 2778 | await writeNoteComments( |
| 2779 | root, |
| 2780 | nextRel, |
| 2781 | source.map((comment) => ({ |
| 2782 | ...comment, |
| 2783 | id: randomUUID(), |
| 2784 | notePath: nextRel, |
| 2785 | createdAt: now, |
| 2786 | updatedAt: now |
| 2787 | })) |
| 2788 | ) |
| 2789 | } |
| 2790 | |
| 2791 | export async function appendToNote( |
| 2792 | root: string, |
no test coverage detected