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

Function formDirFromCsvPath

packages/shared-domain/src/databases.ts:56–64  ·  view source on GitHub ↗
(csvPath: string)

Source from the content-addressed store, hash-verified

54 * database data file. e.g. `a/X.base/data.csv` → `a/X.base`.
55 */
56export function formDirFromCsvPath(csvPath: string): string | null {
57 const p = toPosixPath(csvPath)
58 const slash = p.lastIndexOf('/')
59 if (slash < 0) return null
60 const dir = p.slice(0, slash)
61 const file = p.slice(slash + 1)
62 if (file.toLowerCase() !== FORM_DATA_FILE) return null
63 return isFormDirName(dir) ? dir : null
64}
65
66/** The `data.csv` path for a database folder path. e.g. `a/X.base` → `a/X.base/data.csv`. */
67export function csvPathForFormDir(formDir: string): string {

Callers 15

databases.test.tsFile · 0.90
DatabaseViewFunction · 0.90
titleFromPathFunction · 0.90
pagesToFullFunction · 0.90
pagesToRelativeFunction · 0.90
createRecordPageFunction · 0.90
deleteDatabaseFunction · 0.90
renameDatabaseFunction · 0.90
dbTitleFromPathFunction · 0.90
dbPagesToFullFunction · 0.90
dbPagesToRelativeFunction · 0.90
createRecordPageFunction · 0.90

Calls 2

toPosixPathFunction · 0.85
isFormDirNameFunction · 0.70

Tested by

no test coverage detected