refactor: map instead of pushing
This commit is contained in:
parent
491031a1b5
commit
dd6bb6a8d3
1 changed files with 5 additions and 5 deletions
|
|
@ -250,15 +250,15 @@ function plugins (settings, deviceId) {
|
|||
throw new Error('Denominations and respective counts do not match!')
|
||||
}
|
||||
|
||||
const recyclers = []
|
||||
_.forEach(it => {
|
||||
recyclers.push({
|
||||
const recyclers = _.map(
|
||||
it => ({
|
||||
number: it + 1,
|
||||
name: `recycler${it + 1}`,
|
||||
denomination: parseInt(denominations[it], 10),
|
||||
count: parseInt(counts[it], 10)
|
||||
})
|
||||
}, _.times(_.identity(), numberOfRecyclers))
|
||||
}),
|
||||
_.range(0, numberOfRecyclers)
|
||||
)
|
||||
|
||||
try {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue