(dir: string, out: string[])
| 11 | } |
| 12 | |
| 13 | function scanFiles(dir: string, out: string[]): void { |
| 14 | if (!existsSync(dir)) return |
| 15 | for (const entry of readdirSync(dir, { withFileTypes: true })) { |
| 16 | const fullPath = join(dir, entry.name) |
| 17 | if (entry.isDirectory()) { |
| 18 | scanFiles(fullPath, out) |
| 19 | continue |
| 20 | } |
| 21 | if (['.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs'].includes(extname(entry.name))) { |
| 22 | out.push(fullPath) |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | function hasResolvableTarget(basePath: string): boolean { |
| 28 | const withoutJs = basePath.replace(/\.js$/u, '') |
no test coverage detected