Skip to content

Commit ff2ee18

Browse files
Pat Sissonstrxcllnt
authored andcommitted
fix(groupBy): fixing missing this in groupBy operator prototype signatures
Fixes #33
1 parent 91c36a2 commit ff2ee18

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/add/asynciterable-operators/groupby.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import { groupBy, GroupedAsyncIterable } from '../../asynciterable/groupby';
33
import { identityAsync } from '../../internal/identity';
44

55
export function groupByProto<TSource, TKey>(
6-
source: AsyncIterable<TSource>,
6+
this: AsyncIterable<TSource>,
77
keySelector: (value: TSource) => TKey | Promise<TKey>): AsyncIterableX<GroupedAsyncIterable<TKey, TSource>>;
88
export function groupByProto<TSource, TKey, TValue>(
9-
source: AsyncIterable<TSource>,
9+
this: AsyncIterable<TSource>,
1010
keySelector: (value: TSource) => TKey | Promise<TKey>,
1111
elementSelector?: (value: TSource) => TValue | Promise<TValue>): AsyncIterableX<GroupedAsyncIterable<TKey, TValue>>;
1212
/**
1313
* @ignore
1414
*/
1515
export function groupByProto<TSource, TKey, TValue>(
16-
source: AsyncIterable<TSource>,
16+
this: AsyncIterable<TSource>,
1717
keySelector: (value: TSource) => TKey | Promise<TKey>,
1818
elementSelector: (value: TSource) => TValue | Promise<TValue> = identityAsync): AsyncIterableX<GroupedAsyncIterable<TKey, TValue>> {
19-
return groupBy<TSource, TKey, TValue>(source, keySelector, elementSelector);
19+
return groupBy<TSource, TKey, TValue>(this, keySelector, elementSelector);
2020
}
2121

2222
AsyncIterableX.prototype.groupBy = groupByProto;

src/add/iterable-operators/groupby.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ import { groupBy, GroupedIterable } from '../../iterable/groupby';
33
import { identity } from '../../internal/identity';
44

55
export function groupByProto<TSource, TKey>(
6-
source: Iterable<TSource>,
6+
this: Iterable<TSource>,
77
keySelector: (value: TSource) => TKey): IterableX<GroupedIterable<TKey, TSource>>;
88
export function groupByProto<TSource, TKey, TValue>(
9-
source: Iterable<TSource>,
9+
this: Iterable<TSource>,
1010
keySelector: (value: TSource) => TKey,
1111
elementSelector?: (value: TSource) => TValue): IterableX<GroupedIterable<TKey, TValue>>;
1212
/**
1313
* @ignore
1414
*/
1515
export function groupByProto<TSource, TKey, TValue>(
16-
source: Iterable<TSource>,
16+
this: Iterable<TSource>,
1717
keySelector: (value: TSource) => TKey,
1818
elementSelector: (value: TSource) => TValue = identity): IterableX<GroupedIterable<TKey, TValue>> {
19-
return groupBy<TSource, TKey, TValue>(source, keySelector, elementSelector);
19+
return groupBy<TSource, TKey, TValue>(this, keySelector, elementSelector);
2020
}
2121

2222
IterableX.prototype.groupBy = groupByProto;

0 commit comments

Comments
 (0)