Skip to content

Commit

Permalink
use for of instead of forEach
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
Intizar-T and coderabbitai[bot] authored May 24, 2024
1 parent 0abef89 commit 4a7b4ee
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ function processDirectory(dirPath) {
const entries = fs.readdirSync(dirPath, { withFileTypes: true })
let mapping = {}

entries.forEach((entry) => {
for (const entry of entries) {
const fullPath = path.join(dirPath, entry.name)
if (entry.isDirectory()) {
mapping = { ...mapping, ...processDirectory(fullPath) }
} else if (entry.isFile() && path.extname(entry.name) === '.sol') {
mapping = { ...mapping, ...processFile(fullPath) }
}
})
}

return mapping
}
Expand Down

0 comments on commit 4a7b4ee

Please sign in to comment.