refactor: use destructuring instead of indexing

This commit is contained in:
siiky 2023-10-23 10:19:26 +01:00
parent 23eadc1717
commit 738f4f5b13

View file

@ -158,7 +158,7 @@ function plugins (settings, deviceId) {
throw new Error('Denominations don\'t add up, recyclers were changed.') throw new Error('Denominations don\'t add up, recyclers were changed.')
} }
return _.map(r => r[0] + r[1].provisioned, _.zip(sum, tx.bills)) return _.map(([acc, bill]) => acc + bill.provisioned, _.zip(sum, bills))
} }
const provisioned = _.reduce(sumTxs, _.times(_.constant(0), _.size(recyclers)), redeemableTxs) const provisioned = _.reduce(sumTxs, _.times(_.constant(0), _.size(recyclers)), redeemableTxs)