* Recursively find all JS/MJS files in a directory
(dir, files = [])
| 38 | * Recursively find all JS/MJS files in a directory |
| 39 | */ |
| 40 | function findJsFiles(dir, files = []) { |
| 41 | if (!existsSync(dir)) return files; |
| 42 | |
| 43 | const entries = readdirSync(dir); |
| 44 | for (const entry of entries) { |
| 45 | const fullPath = join(dir, entry); |
| 46 | const stat = statSync(fullPath); |
| 47 | if (stat.isDirectory()) { |
| 48 | findJsFiles(fullPath, files); |
| 49 | } else if (entry.endsWith('.js') || entry.endsWith('.mjs')) { |
| 50 | files.push(fullPath); |
| 51 | } |
| 52 | } |
| 53 | return files; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Check if the dist files contain browser-incompatible imports |
no outgoing calls
no test coverage detected