(root: PathTreeNode, parsedPath: ParsedPath)
| 56 | } |
| 57 | |
| 58 | function addPath(root: PathTreeNode, parsedPath: ParsedPath): void { |
| 59 | let node = root; |
| 60 | for (const component of parsedPath.components) { |
| 61 | const existing = node.children.get(component); |
| 62 | if (existing) { |
| 63 | node = existing; |
| 64 | } else { |
| 65 | const child = createNode(component, childRawPath(node.rawPath, component)); |
| 66 | node.children.set(component, child); |
| 67 | node = child; |
| 68 | } |
| 69 | } |
| 70 | node.label = parsedPath.label; |
| 71 | } |
| 72 | |
| 73 | function relativeRawPath(fromPath: string, toPath: string): string { |
| 74 | if (fromPath === '/') { |
no test coverage detected