(startDir)
| 168 | } |
| 169 | |
| 170 | function listFiles(startDir) { |
| 171 | const results = []; |
| 172 | const ignored = new Set([".git", "node_modules"]); |
| 173 | |
| 174 | function walk(dir) { |
| 175 | for (const entry of readdirSync(dir, { withFileTypes: true })) { |
| 176 | if (ignored.has(entry.name)) continue; |
| 177 | const fullPath = join(dir, entry.name); |
| 178 | if (entry.isDirectory()) { |
| 179 | walk(fullPath); |
| 180 | } else if (entry.isFile()) { |
| 181 | results.push(relativeToRoot(fullPath)); |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | walk(startDir); |
| 187 | return results; |
| 188 | } |
| 189 | |
| 190 | function relativeToRoot(filePath) { |
| 191 | return normalize(filePath).slice(normalize(root).length + 1); |
no test coverage detected