diff --git a/src/calculate-bias.js b/src/calculate-bias.js index 5af890f..cbe0b04 100644 --- a/src/calculate-bias.js +++ b/src/calculate-bias.js @@ -18,17 +18,14 @@ const calculateBias = data => { const currency = data.clusters.find(cluster => cluster.abbr === symbol); if (currency) { - currencies.push(currency); + currencies.push({ + symbol: currency.abbr, + name: currency.display, + influence: currency.score + }); } } - // Format the currency objects - currencies = currencies.map(currency => ({ - symbol: currency.abbr, - name: currency.display, - influence: currency.score - })); - // Derive bias from influence const largestInfluence = Math.max(...currencies.map(currency => currency.influence)); currencies = currencies.map(currency => {