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

Function hydrate

apps/desktop/src/main/databases.ts:128–141  ·  view source on GitHub ↗
(
  rel: string,
  sidecar: DatabaseSidecar,
  rows: DbRow[],
  pageHasContent?: Record<string, boolean>
)

Source from the content-addressed store, hash-verified

126}
127
128function hydrate(
129 rel: string,
130 sidecar: DatabaseSidecar,
131 rows: DbRow[],
132 pageHasContent?: Record<string, boolean>
133): DatabaseDoc {
134 return {
135 ...sidecar,
136 path: toPosix(rel),
137 title: titleFromPath(rel),
138 rows,
139 ...(pageHasContent ? { pageHasContent } : {})
140 }
141}
142
143/** True if a note has body content beyond its frontmatter + a single title heading. */
144function noteHasBody(text: string): boolean {

Callers 4

readDatabaseFunction · 0.70
writeDatabaseRowsFunction · 0.70
writeDatabaseSchemaFunction · 0.70
createDatabaseFunction · 0.70

Calls 2

toPosixFunction · 0.70
titleFromPathFunction · 0.70

Tested by

no test coverage detected