export const groupBy = (array, keySelector) => array.reduce((map, item) => {
    var _a;
    const key = keySelector(item);
    return new Map(map.set(key, ((_a = map.get(key)) !== null && _a !== void 0 ? _a : []).concat([item])));
}, new Map());
//# sourceMappingURL=groupBy.js.map