(dir: string, prefix: string = '')
| 1075 | const files: string[] = []; |
| 1076 | |
| 1077 | function walkDir(dir: string, prefix: string = ''): void { |
| 1078 | const entries = fs.readdirSync(dir, { withFileTypes: true }); |
| 1079 | |
| 1080 | for (const entry of entries) { |
| 1081 | const relativePath = prefix ? `${prefix}/${entry.name}` : entry.name; |
| 1082 | |
| 1083 | // Skip symlinks to prevent following links outside .codegraph |
| 1084 | if (entry.isSymbolicLink()) { |
| 1085 | continue; |
| 1086 | } |
| 1087 | |
| 1088 | if (entry.isDirectory()) { |
| 1089 | walkDir(path.join(dir, entry.name), relativePath); |
| 1090 | } else { |
| 1091 | files.push(relativePath); |
| 1092 | } |
| 1093 | } |
| 1094 | } |
| 1095 | |
| 1096 | walkDir(codegraphDir); |
| 1097 | return files; |
no test coverage detected