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

Function readPageContentFlags

apps/desktop/src/main/databases.ts:152–168  ·  view source on GitHub ↗
(
  root: string,
  pages?: Record<string, string>
)

Source from the content-addressed store, hash-verified

150}
151
152async function readPageContentFlags(
153 root: string,
154 pages?: Record<string, string>
155): Promise<Record<string, boolean> | undefined> {
156 if (!pages || Object.keys(pages).length === 0) return undefined
157 const flags: Record<string, boolean> = {}
158 await Promise.all(
159 Object.entries(pages).map(async ([rowId, notePath]) => {
160 try {
161 flags[rowId] = noteHasBody(await fs.readFile(databaseDataPath(root, notePath), 'utf8'))
162 } catch {
163 /* missing note → leave unset (treated as empty) */
164 }
165 })
166 )
167 return flags
168}
169
170async function persistSidecar(root: string, rel: string, sidecar: DatabaseSidecar): Promise<void> {
171 // Store record-page paths relative to the database folder (so a folder rename

Callers 1

readDatabaseFunction · 0.85

Calls 2

databaseDataPathFunction · 0.90
noteHasBodyFunction · 0.85

Tested by

no test coverage detected