(dir)
| 113 | const results = []; |
| 114 | |
| 115 | async function scanDirectory(dir) { |
| 116 | const files = fs.readdirSync(dir); |
| 117 | |
| 118 | for (const file of files) { |
| 119 | const fullPath = path.join(dir, file); |
| 120 | const stat = fs.statSync(fullPath); |
| 121 | |
| 122 | if (stat.isDirectory()) { |
| 123 | await scanDirectory(fullPath); |
| 124 | } else if (stat.isFile()) { |
| 125 | const result = await compressFile(fullPath); |
| 126 | if (result) { |
| 127 | results.push(result); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | |
| 133 | await scanDirectory(dirPath); |
| 134 | return results; |
no test coverage detected