(dir, rel)
| 247 | // Amalgamation |
| 248 | |
| 249 | function joinPath(dir, rel) { |
| 250 | if (rel.startsWith('/')) return rel.slice(1); |
| 251 | const parts = (dir + '/' + rel).split('/'); |
| 252 | const stack = []; |
| 253 | for (const part of parts) { |
| 254 | if (part === '' || part === '.') continue; |
| 255 | if (part === '..') { stack.pop(); continue; } |
| 256 | stack.push(part); |
| 257 | } |
| 258 | return stack.join('/'); |
| 259 | } |
| 260 | |
| 261 | function divider() { |
| 262 | return '//' + '-'.repeat(118) + '\n'; |
nothing calls this directly
no test coverage detected