electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
436 stars 104 forks source link

Fix error in bank integrations category matching objects. #455

Closed pierresegonne closed 4 years ago

pierresegonne commented 4 years ago

Issue

Rookie mistake: the arrow function inside the map would not return a list of entries from which the object can be rebuilt. So it failed!

madsnedergaard commented 4 years ago

Didn't think about this earlier, but Object.fromEntries() is only available in NodeJS 12+.

Can we achieve the same with either some lodash functionality or just .reduce()?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries

Screenshot 2020-09-23 at 17 09 03