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

11 lines
312 B
TypeScript
Raw Normal View History

2023-12-24 10:21:40 -05:00
import {FSData} from '../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
}