(file: string, folder: string)
| 95 | } |
| 96 | |
| 97 | export function isWithinPath(file: string, folder: string) { |
| 98 | const relative = path.relative(folder.toLowerCase(), file.toLowerCase()); |
| 99 | return !!relative && !relative.startsWith("..") && !path.isAbsolute(relative); |
| 100 | } |
| 101 | |
| 102 | export function isWithinPathOrEqual(file: string, folder: string) { |
| 103 | const relative = path.relative(folder.toLowerCase(), file.toLowerCase()); |
no outgoing calls
no test coverage detected