(file: string, folder: string)
| 100 | } |
| 101 | |
| 102 | export function isWithinPathOrEqual(file: string, folder: string) { |
| 103 | const relative = path.relative(folder.toLowerCase(), file.toLowerCase()); |
| 104 | return relative === "" || (!!relative && !relative.startsWith("..") && !path.isAbsolute(relative)); |
| 105 | } |
| 106 | |
| 107 | export function findCommonAncestorFolder(folderPaths: string[]): string | undefined { |
| 108 | if (!folderPaths.length) |
no outgoing calls