(filePath: string, directoryPath: string)
| 369 | } |
| 370 | |
| 371 | async function assertRealPathInsideDirectory(filePath: string, directoryPath: string): Promise<void> { |
| 372 | if (!(await isRealPathInsideDirectory(filePath, directoryPath))) { |
| 373 | throw new Error("Rule path must stay inside the rules directory") |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | async function isRealPathInsideDirectory(filePath: string, directoryPath: string): Promise<boolean> { |
| 378 | const [realFilePath, realDirectoryPath] = await Promise.all([fs.realpath(filePath), fs.realpath(directoryPath)]) |
no test coverage detected