Read a vault file's text, or null when missing/unreadable (matches the * desktop's optional-file reads, which treat ENOENT/parse errors as absent).
(relPath: string)
| 645 | /** Read a vault file's text, or null when missing/unreadable (matches the |
| 646 | * desktop's optional-file reads, which treat ENOENT/parse errors as absent). */ |
| 647 | async function readFileTextOrNull(relPath: string): Promise<string | null> { |
| 648 | try { |
| 649 | return (await readNote(relPath)).body |
| 650 | } catch { |
| 651 | return null |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | /** True if a note has body beyond frontmatter + a single title heading. */ |
| 656 | function dbNoteHasBody(text: string): boolean { |
no test coverage detected