(root: string, relPath: string)
| 126 | } |
| 127 | |
| 128 | function resolveChildPath(root: string, relPath: string): string { |
| 129 | const absRoot = path.resolve(root); |
| 130 | const absPath = path.resolve(absRoot, relPath); |
| 131 | if (!isWithinRoot(absRoot, absPath)) { |
| 132 | throw new Error('path outside root'); |
| 133 | } |
| 134 | return absPath; |
| 135 | } |
| 136 | |
| 137 | async function resolveSafeChildPath(root: string, relPath: string): Promise<string> { |
| 138 | const absRoot = path.resolve(root); |
no test coverage detected