`a/b/../c` zu `a/c`. Rein textlich; es wird nichts am Dateisystem geprueft.
(path: string)
| 199 | |
| 200 | /** `a/b/../c` zu `a/c`. Rein textlich; es wird nichts am Dateisystem geprueft. */ |
| 201 | function normalizePath(path: string): string { |
| 202 | const out: string[] = []; |
| 203 | for (const segment of path.split('/')) { |
| 204 | if (segment === '' || segment === '.') { |
| 205 | continue; |
| 206 | } |
| 207 | if (segment === '..') { |
| 208 | out.pop(); |
| 209 | continue; |
| 210 | } |
| 211 | out.push(segment); |
| 212 | } |
| 213 | return out.join('/'); |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Welche indizierte Datei ein Spezifizierer meint, wenn eine davon passt. |
no test coverage detected