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!')
|
throw new Error('Denominations and respective counts do not match!')
|
||||||
}
|
}
|
||||||
|
|
||||||
const recyclers = []
|
const recyclers = _.map(
|
||||||
_.forEach(it => {
|
it => ({
|
||||||
recyclers.push({
|
|
||||||
number: it + 1,
|
number: it + 1,
|
||||||
name: `recycler${it + 1}`,
|
name: `recycler${it + 1}`,
|
||||||
denomination: parseInt(denominations[it], 10),
|
denomination: parseInt(denominations[it], 10),
|
||||||
count: parseInt(counts[it], 10)
|
count: parseInt(counts[it], 10)
|
||||||
})
|
}),
|
||||||
}, _.times(_.identity(), numberOfRecyclers))
|
_.range(0, numberOfRecyclers)
|
||||||
|
)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue