(items: (PackItem | Item)[])
| 5 | import { Option } from "app/components/FormFields/types"; |
| 6 | |
| 7 | export const getCategories = (items: (PackItem | Item)[]): Category[] => { |
| 8 | const categories = items.map(item => item.Category); |
| 9 | return uniqBy(categories, 'id').sort((a, b) => a.id - b.id); |
| 10 | }; |
| 11 | |
| 12 | export const getItemsByCategory = (items: (PackItem | Item)[]): CategoryItems[] => { |
| 13 | const categories = getCategories(items); |
no outgoing calls
no test coverage detected