mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 13:00:58 -05:00
11 lines
313 B
TypeScript
11 lines
313 B
TypeScript
import {FSData} from 'src/interfaces';
|
|
|
|
export default function(data:FSData) {
|
|
const pallets = data.vehicles.filter(x=>x.category === 'PALLETS');
|
|
const counts = pallets.reduce((acc, name)=>{
|
|
acc[name.name] = (acc[name.name] ?? 0) + 1;
|
|
return acc;
|
|
}, {} as {[key:string]:number});
|
|
return counts;
|
|
}
|