(path: string)
| 91 | |
| 92 | /** Ein Pfad ohne fuehrende Punkte und Schraegstriche, mit `/` als Trenner. */ |
| 93 | export function normalizePath(path: string): string { |
| 94 | let value = path.trim().replace(/\\/g, '/'); |
| 95 | while (value.startsWith('./')) { |
| 96 | value = value.slice(2); |
| 97 | } |
| 98 | while (value.startsWith('/')) { |
| 99 | value = value.slice(1); |
| 100 | } |
| 101 | while (value.endsWith('/') && value.length > 1) { |
| 102 | value = value.slice(0, -1); |
| 103 | } |
| 104 | return value; |
| 105 | } |
| 106 | |
| 107 | /** Den Index einmal bauen. */ |
| 108 | export function buildPlacementIndex(nodes: readonly GraphNode[]): PlacementIndex { |
no outgoing calls
no test coverage detected