(somePath: Path, parentPath: Path)
| 59 | * isSubpath('/a/x', '/a/b') // false - x is not under b |
| 60 | */ |
| 61 | export function isSubpath(somePath: Path, parentPath: Path): boolean { |
| 62 | const rel = path.relative(parentPath, somePath); |
| 63 | return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel)); |
| 64 | } |
no outgoing calls
no test coverage detected