(filePath)
| 32 | } |
| 33 | |
| 34 | async function checkFile(filePath) { |
| 35 | const content = await readFile(filePath, 'utf-8'); |
| 36 | |
| 37 | // Count occurrences of the pattern |
| 38 | const matches = content.match(new RegExp(PATTERN.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g')); |
| 39 | const count = matches ? matches.length : 0; |
| 40 | |
| 41 | return { |
| 42 | filePath, |
| 43 | count, |
| 44 | hasDuplicate: count > 1 |
| 45 | }; |
| 46 | } |
| 47 | |
| 48 | async function main() { |
| 49 | const targetDir = process.argv[2] || join(__dirname, '..', 'dist'); |
nothing calls this directly
no outgoing calls
no test coverage detected