Skip to content

Commit c37100c

Browse files
fix(list): Improve Join and GroupJoin typings (#173)
Co-authored-by: Marlon Tucker <marlon.tucker@aareon.com>
1 parent 87c7c26 commit c37100c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/list.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ class List<T> {
233233
* Correlates the elements of two sequences based on equality of keys and groups the results.
234234
* The default equality comparer is used to compare keys.
235235
*/
236-
public GroupJoin<U>(
236+
public GroupJoin<U, R>(
237237
list: List<U>,
238238
key1: (k: T) => any,
239239
key2: (k: U) => any,
240-
result: (first: T, second: List<U>) => any
241-
): List<any> {
240+
result: (first: T, second: List<U>) => R
241+
): List<R> {
242242
return this.Select(x =>
243243
result(
244244
x,
@@ -275,12 +275,12 @@ class List<T> {
275275
/**
276276
* Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.
277277
*/
278-
public Join<U>(
278+
public Join<U, R>(
279279
list: List<U>,
280280
key1: (key: T) => any,
281281
key2: (key: U) => any,
282-
result: (first: T, second: U) => any
283-
): List<any> {
282+
result: (first: T, second: U) => R
283+
): List<R> {
284284
return this.SelectMany(x =>
285285
list.Where(y => key2(y) === key1(x)).Select(z => result(x, z))
286286
)

0 commit comments

Comments
 (0)