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

Function readFileTextOrNull

apps/web/src/bridge/http-bridge.ts:647–653  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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). */
647async 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. */
656function dbNoteHasBody(text: string): boolean {

Callers 6

dbReadSidecarFunction · 0.85
dbReadPageFlagsFunction · 0.85
openDatabaseFunction · 0.85
createDatabaseFunction · 0.85
createRecordPageFunction · 0.85
renameDatabaseFunction · 0.85

Calls 1

readNoteFunction · 0.70

Tested by

no test coverage detected