(dir: string, prefix: string = '')
| 504 | const files: string[] = []; |
| 505 | |
| 506 | function walkDir(dir: string, prefix: string = ''): void { |
| 507 | const entries = fs.readdirSync(dir, { withFileTypes: true }); |
| 508 | |
| 509 | for (const entry of entries) { |
| 510 | const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name; |
| 511 | |
| 512 | // Skip symlinks to prevent following links outside .codegraph |
| 513 | if (entry.isSymbolicLink()) { |
| 514 | continue; |
| 515 | } |
| 516 | |
| 517 | if (entry.isDirectory()) { |
| 518 | walkDir(path.join(dir, entry.name), relativePath); |
| 519 | } else { |
| 520 | files.push(relativePath); |
| 521 | } |
| 522 | } |
| 523 | } |
| 524 | |
| 525 | walkDir(codegraphDir); |
| 526 | return files; |
no test coverage detected