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

Function dbTitleFromPath

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

Title of a database from its data.csv path.

(csvPath: string)

Source from the content-addressed store, hash-verified

636
637/** Title of a database from its data.csv path. */
638function dbTitleFromPath(csvPath: string): string {
639 const posix = dbToPosix(csvPath)
640 if (formDirFromCsvPath(posix)) return formTitleFromCsvPath(posix)
641 const base = posix.split('/').filter(Boolean).pop() ?? csvPath
642 return base.replace(/\.csv$/i, '')
643}
644
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). */

Callers 2

dbHydrateFunction · 0.85
listDatabasesFunction · 0.85

Calls 3

formDirFromCsvPathFunction · 0.90
formTitleFromCsvPathFunction · 0.90
dbToPosixFunction · 0.85

Tested by

no test coverage detected