From 491031a1b524e01ac3f98e495b52d177978f7082 Mon Sep 17 00:00:00 2001 From: siiky Date: Mon, 23 Oct 2023 10:10:08 +0100 Subject: [PATCH] refactor: map instead of pushing --- lib/plugins.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/plugins.js b/lib/plugins.js index 6f799acf..50442334 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -239,11 +239,10 @@ function plugins (settings, deviceId) { .then(([{ counts, numberOfRecyclers }, redeemableTxs]) => { redeemableTxs = _.reject(_.matchesProperty('id', excludeTxId), redeemableTxs) - const denominations = [] - - _.forEach(it => { - denominations.push(cashOutConfig[`recycler${it + 1}`]) - }, _.times(_.identity(), numberOfRecyclers)) + const denominations = _.map( + it => cashOutConfig[`recycler${it}`], + _.range(1, numberOfRecyclers+1) + ) const virtualRecyclers = denominations.length ? [Math.max(..._.flatten(denominations)) * 2] : []