diff options
Diffstat (limited to '')
-rw-r--r-- | nodejs/lib/utils.js | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/nodejs/lib/utils.js b/nodejs/lib/utils.js deleted file mode 100644 index a2c8128..0000000 --- a/nodejs/lib/utils.js +++ /dev/null @@ -1,18 +0,0 @@ -// cargo is a ship.cargo object, want is an optional symbol -export function categorizeCargo(cargo, want) { - const wanted = cargo.inventory.filter(i => i.symbol === want || i.symbol === 'ANTIMATTER'); - const goods = cargo.inventory.filter(i => i.symbol !== want && i.symbol !== 'ANTIMATTER'); - const wobj = wanted.reduce(function(acc, e) { - acc[e.symbol] = e.units; - return acc; - }, {}); - const gobj = goods.reduce(function(acc, e) { - acc[e.symbol] = e.units; - return acc; - }, {}); - return {wanted: wobj, goods: gobj}; -} - -export function systemFromWaypoint(waypoint) { - return waypoint.split('-').slice(0,2).join('-'); -} |