Title of a database from its data.csv path.
(csvPath: string)
| 636 | |
| 637 | /** Title of a database from its data.csv path. */ |
| 638 | function 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). */ |
no test coverage detected