Closed sarimarton closed 5 months ago
My solution is the following lines:
type ObjectGroupBy = <T, K extends PropertyKey | undefined>(
items: Iterable<T>,
keySelector: (item: T, index: number) => K
) => Record<Exclude<K, undefined>, T[]>
const objectGroupBy = Object.groupBy as ObjectGroupBy
sorry, invalid issue
I'm just passing by to leave an issue as a reminder, as I notice there isn't one yet.
Sorry that I don't have time to contribute.
It would be great to have a better typing in cases like