( entry: Dirent, dirPath: string, fileInfo: RuleFileInfo[], depth: number, rulesDirectoryPath: string, originalDirPath = dirPath, )
| 216 | } |
| 217 | |
| 218 | async function resolveRuleDirectoryEntry( |
| 219 | entry: Dirent, |
| 220 | dirPath: string, |
| 221 | fileInfo: RuleFileInfo[], |
| 222 | depth: number, |
| 223 | rulesDirectoryPath: string, |
| 224 | originalDirPath = dirPath, |
| 225 | ): Promise<void> { |
| 226 | if (depth > MAX_DEPTH) { |
| 227 | return |
| 228 | } |
| 229 | |
| 230 | const fullPath = path.resolve(entry.parentPath || dirPath, entry.name) |
| 231 | const originalPath = path.join(originalDirPath, path.relative(dirPath, fullPath)) |
| 232 | if (entry.isFile()) { |
| 233 | if (await isRealPathInsideDirectory(fullPath, rulesDirectoryPath)) { |
| 234 | fileInfo.push({ originalPath, resolvedPath: fullPath, isSymlink: originalPath !== fullPath }) |
| 235 | } |
| 236 | } else if (entry.isSymbolicLink()) { |
| 237 | await resolveRuleSymlink(fullPath, fileInfo, depth + 1, rulesDirectoryPath, originalPath) |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | async function resolveRuleSymlink( |
| 242 | symlinkPath: string, |
no test coverage detected