1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 08:20:58 -05:00
Daggerbot-TS/src/helpers/PalletLibrary.ts

11 lines
313 B
TypeScript
Raw Normal View History

import {FSData} from 'src/interfaces';
2023-10-02 13:05:51 -04:00
2023-12-24 10:21:40 -05:00
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;
2023-10-02 13:05:51 -04:00
}