-
Notifications
You must be signed in to change notification settings - Fork 648
refactor(cli/unstable): make ProgressBar
options
optional
#6407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
refactor(cli/unstable): make ProgressBar
options
optional
#6407
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6407 +/- ##
=======================================
Coverage 94.54% 94.54%
=======================================
Files 580 580
Lines 43730 43731 +1
Branches 6471 6471
=======================================
+ Hits 41345 41346 +1
Misses 2342 2342
Partials 43 43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not a fan of this change as, I imagine you're always going to want to set a |
I don't think WDYT? |
It will throw when the maths has |
I'll have a look at that. clamping these values seems like a good idea anyway. |
Because this module formats the value as byte numbers by default, setting max=1 as default feels strange to me.
If we consider |
I was thinking about this a bit. Another option would be to remove the custom type ProgressBarType = "percentage" | "download"
new ProgressBar({ type: "percentage" }) // [###-------] [30%]
new ProgressBar({ type: "download" }) // [mm:ss] [###-------] [0.40/97.66 KiB] This would be less customizable but simplify the api. I am aware that I proposed the format property instead of style options. |
This PR make
ProgressBar
options
an optional argument. This is done by settingoptions.max
to1
by default. This default value is taken from HTMLProgressElement.