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

Function dbNoteHasBody

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

True if a note has body beyond frontmatter + a single title heading.

(text: string)

Source from the content-addressed store, hash-verified

654
655/** True if a note has body beyond frontmatter + a single title heading. */
656function dbNoteHasBody(text: string): boolean {
657 let body = text
658 const fm = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(body)
659 if (fm) body = body.slice(fm[0].length)
660 body = body.replace(/^\s*#[^\n]*\r?\n?/, '')
661 return body.trim().length > 0
662}
663
664/** Defensive sidecar parse — mirror of databases.ts normalizeSidecar. */
665function dbNormalizeSidecar(raw: unknown): DatabaseSidecar | null {

Callers 1

dbReadPageFlagsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected