(relPath: string)
| 85 | * otherwise null. e.g. `a/X.base/pages/r.md` → `a/X.base`. |
| 86 | */ |
| 87 | export function formDirContaining(relPath: string): string | null { |
| 88 | const parts = toPosixPath(relPath).split('/') |
| 89 | for (let i = 0; i < parts.length; i++) { |
| 90 | if (parts[i].toLowerCase().endsWith(FORM_DIR_SUFFIX)) { |
| 91 | return parts.slice(0, i + 1).join('/') |
| 92 | } |
| 93 | } |
| 94 | return null |
| 95 | } |
| 96 | |
| 97 | /** Display title from a database folder name/path (strips the `.base` suffix). */ |
| 98 | export function formTitleFromDir(nameOrPath: string): string { |
no test coverage detected