Skip to content

Commit

Permalink
refactor(stream-transform-from): reduce Cognitive Complexity in the `…
Browse files Browse the repository at this point in the history
…TransformFromAsyncIterable#finish()` method

Code Climate reported:

+ Function `finish` has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
  • Loading branch information
sounisi5011 committed May 21, 2021
1 parent 5c1eb3d commit 38d4cfe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/stream-transform-from/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,8 @@ export class TransformFromAsyncIterable<
this.destroy(error);
}
} else {
if (!this.callTransformCallback(null, null)) {
this.push(null);
}
this.push(null);
this.callTransformCallback();
}
}

Expand Down

0 comments on commit 38d4cfe

Please sign in to comment.