Skip to content

Commit

Permalink
Fixed imprper generator exit
Browse files Browse the repository at this point in the history
  • Loading branch information
ENikS committed Sep 22, 2016
1 parent 28150f2 commit 38e7eb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export function* SkipWhile<T>(target: Iterable<T>, predicate: (x: T, i: number)
export function* TakeWhile<T>(target: Iterable<T>, predicate: (x: T, i: number) => Boolean) {
let index = 0;
for (let value of target) {
if (!predicate(value, index++)) return;
if (!predicate(value, index++)) break;
yield value;
}
}
Expand Down

0 comments on commit 38e7eb0

Please sign in to comment.