(root: string, rel: string)
| 2641 | } |
| 2642 | |
| 2643 | export async function readNote(root: string, rel: string): Promise<NoteContent> { |
| 2644 | const abs = resolveSafe(root, rel) |
| 2645 | const folder = folderOf(root, abs) |
| 2646 | if (!folder) throw new Error(`Note not in a known folder: ${rel}`) |
| 2647 | const body = await fs.readFile(abs, 'utf8') |
| 2648 | const meta = await readMeta(root, abs, folder) |
| 2649 | return { ...meta, body } |
| 2650 | } |
| 2651 | |
| 2652 | export async function writeNote(root: string, rel: string, body: string): Promise<NoteMeta> { |
| 2653 | const abs = resolveSafe(root, rel) |
no test coverage detected