(parent: string, child: string)
| 75 | } |
| 76 | |
| 77 | function isSubPath(parent: string, child: string): boolean { |
| 78 | const parentPath = normalizePathForCompare(parent) |
| 79 | const childPath = normalizePathForCompare(child) |
| 80 | |
| 81 | if (parentPath === childPath) return false |
| 82 | return childPath.startsWith(`${parentPath}${path.sep}`) |
| 83 | } |
| 84 | |
| 85 | function isPathSafe(targetPath: string): boolean { |
| 86 | const normalizedTarget = targetPath.toLowerCase().replace(/\//g, '\\') |
no test coverage detected