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

Function isDatabaseCsvPath

packages/shared-domain/src/databases.ts:287–293  ·  view source on GitHub ↗
(relPath: string)

Source from the content-addressed store, hash-verified

285
286/** True for a database data file: new `<Name>.base/data.csv`, or a legacy loose `.csv`. */
287export function isDatabaseCsvPath(relPath: string): boolean {
288 if (formDirFromCsvPath(relPath)) return true
289 const lower = toPosixPath(relPath).toLowerCase()
290 // Legacy loose CSV — but not one that lives inside a `.base` folder.
291 if (formDirContaining(relPath)) return false
292 return lower.endsWith('.csv') && !lower.endsWith(`.csv${DATABASE_SIDECAR_SUFFIX}`)
293}
294
295/**
296 * Given any file that belongs to a database (`data.csv`, `schema.json`, or a

Callers 6

databases.test.tsFile · 0.90
isDatabaseSurfaceTabPathFunction · 0.90
EditorPaneFunction · 0.90
openAssetFunction · 0.90
NoteListFunction · 0.90
databaseCsvPathForFunction · 0.85

Calls 3

formDirFromCsvPathFunction · 0.85
toPosixPathFunction · 0.85
formDirContainingFunction · 0.85

Tested by

no test coverage detected