(path: string | null | undefined)
| 238 | } |
| 239 | |
| 240 | export function csvPathFromDatabaseTab(path: string | null | undefined): string | null { |
| 241 | if (!path || !isDatabaseTabPath(path)) return null |
| 242 | const encoded = path.slice(DATABASE_TAB_PREFIX.length) |
| 243 | if (!encoded) return null |
| 244 | try { |
| 245 | return decodeURIComponent(encoded) |
| 246 | } catch { |
| 247 | return encoded |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | export function databaseTitleFromTab(path: string | null | undefined): string { |
| 252 | const csv = csvPathFromDatabaseTab(path) |
no test coverage detected