(dir, rel)
| 82 | } |
| 83 | |
| 84 | function joinPath(dir, rel) { |
| 85 | if (rel.startsWith('/')) return rel.slice(1); |
| 86 | const parts = (dir + '/' + rel).split('/'); |
| 87 | const stack = []; |
| 88 | for (const part of parts) { |
| 89 | if (part === '' || part === '.') continue; |
| 90 | if (part === '..') { stack.pop(); continue; } |
| 91 | stack.push(part); |
| 92 | } |
| 93 | return stack.join('/'); |
| 94 | } |
| 95 | |
| 96 | function libraryNameFromPath(path) { |
| 97 | const parts = path.split('/'); |
no test coverage detected