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

Function formTitleFromDir

packages/shared-domain/src/databases.ts:98–103  ·  view source on GitHub ↗
(nameOrPath: string)

Source from the content-addressed store, hash-verified

96
97/** Display title from a database folder name/path (strips the `.base` suffix). */
98export function formTitleFromDir(nameOrPath: string): string {
99 const name = lastSegment(nameOrPath)
100 return name.toLowerCase().endsWith(FORM_DIR_SUFFIX)
101 ? name.slice(0, -FORM_DIR_SUFFIX.length)
102 : name
103}
104
105/** Display title from a database's `data.csv` path. */
106export function formTitleFromCsvPath(csvPath: string): string {

Callers 3

SidebarFunction · 0.90
SubTreeFunction · 0.90
formTitleFromCsvPathFunction · 0.85

Calls 1

lastSegmentFunction · 0.85

Tested by

no test coverage detected