* Recursively find all JS/MJS files in a directory
(dir, files = [])
| 118 | * Recursively find all JS/MJS files in a directory |
| 119 | */ |
| 120 | function findJsFiles(dir, files = []) { |
| 121 | if (!existsSync(dir)) return files; |
| 122 | |
| 123 | const entries = readdirSync(dir); |
| 124 | for (const entry of entries) { |
| 125 | const fullPath = join(dir, entry); |
| 126 | const stat = statSync(fullPath); |
| 127 | if (stat.isDirectory()) { |
| 128 | findJsFiles(fullPath, files); |
| 129 | } else if (entry.endsWith('.js') || entry.endsWith('.mjs')) { |
| 130 | files.push(fullPath); |
| 131 | } |
| 132 | } |
| 133 | return files; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * Check if the dist files contain browser-incompatible imports |
no outgoing calls
no test coverage detected