Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Oct 25, 2024
1 parent eef391d commit c206a5e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/governor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ export abstract class Governor {
}

wrapIterator<T>(iter: Iterator<T> | AsyncIterator<T>): AsyncIterator<T> {
const _this = this;
return {
next: async function(n) {
return await _this.wrap(iter.next as Iterator<T>['next']).call(iter, n);
},
next: async (n) =>
await this.wrap(iter.next as Iterator<T>['next']).call(iter, n)
,
return: async () =>
typeof iter.return === "function"
? iter.return()
Expand Down

0 comments on commit c206a5e

Please sign in to comment.