Skip to content

Commit

Permalink
fix(output): handle the case when progress ration is greater than 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBuchholz committed Apr 5, 2024
1 parent 14224d5 commit 757a2b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/output.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function * bar (ratio, msg) {
}
yield '] '
} else {
const filled = Math.floor(BAR_WIDTH * ratio)
const filled = Math.floor(BAR_WIDTH * Math.min(ratio, 1))
yield ''.padEnd(filled, '\u2588')
yield ''.padEnd(BAR_WIDTH - filled, '\u2591')
yield '] '
Expand Down

0 comments on commit 757a2b7

Please sign in to comment.