(raw: string)
| 411 | } |
| 412 | |
| 413 | export function normalizeDesignFilePath(raw: string): string { |
| 414 | const s = raw.trim(); |
| 415 | if (s.length === 0) throw new Error('path must not be empty'); |
| 416 | if (s.startsWith('/') || /^[a-zA-Z]:[\\/]/.test(s)) { |
| 417 | throw new Error(`path must be relative: ${raw}`); |
| 418 | } |
| 419 | const parts = s.replaceAll('\\', '/').split('/'); |
| 420 | for (const part of parts) { |
| 421 | if (part === '..' || part === '') throw new Error(`invalid path segment in ${raw}`); |
| 422 | } |
| 423 | return parts.join('/'); |
| 424 | } |
| 425 | |
| 426 | export function listDesignFiles(_db: Database, _designId: string): DesignFile[] { |
| 427 | const design = getDesign(_db, _designId); |
no outgoing calls
no test coverage detected