mihaifm / linq

linq.js - LINQ for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

groupby compareSelector overload wrong typing

bessgeor opened this issue · comments

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.

@mihaifm I believe this issue is arleady solved. Also, a new version (3.2.0) with the new iterator support would be great!

@MurariAlex Thanks, it's solved indeed. I'll publish to npm shortly.