(dir, predicate)
| 86 | } |
| 87 | |
| 88 | function listFiles(dir, predicate) { |
| 89 | const entries = fs.readdirSync(dir, { withFileTypes: true }); |
| 90 | return entries.flatMap((entry) => { |
| 91 | const absolutePath = path.join(dir, entry.name); |
| 92 | if (entry.isDirectory()) { |
| 93 | return listFiles(absolutePath, predicate); |
| 94 | } |
| 95 | |
| 96 | return predicate(absolutePath) ? [absolutePath] : []; |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | function extractStringArrayConstant(source, exportName) { |
| 101 | const marker = `export const ${exportName} = [`; |
no test coverage detected