groupby compareSelector overload wrong typing
bessgeor opened this issue · comments
bessgeor commented
Current typing is
groupBy<TKey, TElement, TResult, TCompare>(
keySelector: (element: T) => TKey,
elementSelector: (element: T) => TElement,
resultSelector: (key: TKey, element: IEnumerable<TElement>) => TResult,
compareSelector: (element: T) => TCompare
): IEnumerable<TResult>;
But the compareSelector
actually accepts parameter of type TKey
, not T
(which is more intuitive than T
, BTW).
This probably happens because it is passed as a dictionary comparer inside of toLookup
method, but I haven't investigated this further.
Alexandre Murari Junior commented
@mihaifm I believe this issue is arleady solved. Also, a new version (3.2.0) with the new iterator support would be great!
Mihai Ciuraru commented
@MurariAlex Thanks, it's solved indeed. I'll publish to npm shortly.