(parent: string, target: string)
| 36 | } |
| 37 | |
| 38 | function isWithinPath(parent: string, target: string): boolean { |
| 39 | const relative = path.relative(path.resolve(parent), path.resolve(target)); |
| 40 | return relative === "" || (!relative.startsWith(`..${path.sep}`) && relative !== ".." && !path.isAbsolute(relative)); |
| 41 | } |
| 42 | |
| 43 | function toGitPath(filePath: string): string { |
| 44 | return filePath.split(path.sep).join("/"); |
no outgoing calls
no test coverage detected