(command)
| 73 | const canonicalBase = realpath(resolved); |
| 74 | return path.resolve(canonicalBase, ...missing); |
| 75 | } |
| 76 | |
| 77 | function isContainedPath(candidate, root) { |
| 78 | const relative = path.relative(root, candidate); |
| 79 | return relative === '' || ( |
| 80 | relative !== '..' |
| 81 | && !relative.startsWith(`..${path.sep}`) |
| 82 | && !path.isAbsolute(relative) |