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

Function databaseTitleFromTab

packages/shared-domain/src/databases.ts:251–258  ·  view source on GitHub ↗
(path: string | null | undefined)

Source from the content-addressed store, hash-verified

249}
250
251export function databaseTitleFromTab(path: string | null | undefined): string {
252 const csv = csvPathFromDatabaseTab(path)
253 if (!csv) return 'Database'
254 // A database's title is its `<Name>.base` folder name, not the `data.csv` basename.
255 if (formDirFromCsvPath(csv)) return formTitleFromCsvPath(csv)
256 const base = csv.split('/').filter(Boolean).pop() ?? csv
257 return base.replace(/\.csv$/i, '')
258}
259
260/** True for the sidecar file path (`*.csv.base.json`). */
261export function isDatabaseSidecarPath(relPath: string): boolean {

Callers 2

databases.test.tsFile · 0.90
EditorPaneFunction · 0.90

Calls 3

csvPathFromDatabaseTabFunction · 0.85
formDirFromCsvPathFunction · 0.85
formTitleFromCsvPathFunction · 0.85

Tested by

no test coverage detected