Database title: its `.base` folder name (legacy: the `.csv` basename).
(rel: string)
| 47 | |
| 48 | /** Database title: its `.base` folder name (legacy: the `.csv` basename). */ |
| 49 | function titleFromPath(rel: string): string { |
| 50 | const posix = toPosix(rel) |
| 51 | if (formDirFromCsvPath(posix)) return formTitleFromCsvPath(posix) |
| 52 | const base = posix.split('/').filter(Boolean).pop() ?? rel |
| 53 | return base.replace(/\.csv$/i, '') |
| 54 | } |
| 55 | |
| 56 | // Record-page paths are stored RELATIVE to the database folder (e.g. `pages/X.md`) |
| 57 | // so a folder rename/move never rewrites them; on read they're resolved to full |
no test coverage detected