Skip to content

Commit

Permalink
Update to latest speck
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Aug 15, 2016
1 parent 2a136f6 commit 1d4a6a7
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ x64/
x86/
build/
bld/
typings/
bin/
obj/
.vs/
Expand All @@ -43,4 +42,6 @@ lib/iterators.d.ts
lib/iterators.ts
lib/linq.ts
lib/utilities.d.ts
lib/utilities.ts
lib/utilities.ts
typings/chai-3.2.0.d.ts
typings/mocha.2.2.5.d.ts
2 changes: 1 addition & 1 deletion .vsnodetools.njsproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<TestFramework>Mocha</TestFramework>
</TypeScriptCompile>
<TypeScriptCompile Include="typings\chai-3.2.0.d.ts" />
<TypeScriptCompile Include="typings\es2015-shim.d.ts" />
<TypeScriptCompile Include="typings\es6-shim.d.ts" />
<TypeScriptCompile Include="typings\mocha.2.2.5.d.ts" />
</ItemGroup>
<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions lib/iterators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,12 @@ export class DefaultIfEmpty<T> extends IteratorBase<T> {

export class ChunkBy<T, K, E, V> extends IteratorBase<T> {

private index = 0;
private key: K;
private box: Array<E>;;

constructor(target: Iterator<T>,
private keySelect: (x: T) => K,
private keySelect: (x: T, i: number) => K,
private elementSelector: (x: T) => E,
private resultSelector: (a: K, b: Iterable<E>) => V) {
super(target);
Expand All @@ -155,7 +156,7 @@ export class ChunkBy<T, K, E, V> extends IteratorBase<T> {
return result;
} else return this._done;
}
let newKey = this.keySelect(result.value);
let newKey = this.keySelect(result.value, this.index++);
if (this.key !== newKey && this.box) {
let ret = { done: false, value: this.resultSelector(this.key, this.box) };
this.key = newKey;
Expand Down
2 changes: 1 addition & 1 deletion lib/linq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ class EnumerableImpl<T> implements Enumerable<T>, Iterable<T>, IEnumerable<T> {
}


public ChunkBy<K, E, V>(keySelect: (x: T) => K,
public ChunkBy<K, E, V>(keySelect: (x: T, i: number) => K,
elementSelector: (x: T) => E = Constant.selfFn,
resultSelector: (a: K, b: Iterable<E>) => V = (a, b) => b as any):
Enumerable<V> {
Expand Down
File renamed without changes.

0 comments on commit 1d4a6a7

Please sign in to comment.