import Dict from "./Dict"; export default ( loose: Iterable, prop: P ) => { const groups = new Dict[]>(); for (const { [prop]: propValue, ...obj } of loose) { groups.computeIfAbsent(propValue, () => []).push(obj); } return groups; };