-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
Hide prefixText
when it's an empty string
#124
Conversation
I think it would be better to fix the JS code to also accept an empty string, without adding the padding. I prefer to keep TS types as simple as possible. |
@sindresorhus But we will have inconsistency then.
and no way to put just one space in. |
Also, as it can be |
Good point. I missed your comment in the issue. Ignore my previous comment. |
Can you document in words that setting it to |
Hmm, actually, thinking about this more, would anyone actually want an empty space before the spinner? Seems logical to me that the empty space is just a joiner, so when |
@stroncium ⬆️ |
@sindresorhus Feels weird to introduce additional code so that instead of just setting something to empty string and getting predictable result he'd set it to empty string, get unpredictable result and need to set up another option in order for result to get to what was predicted, no? |
One way to fix the mess is to force users (by redesigning the APIs?) to create a new instance of ora every time, instead of allowing users to reuse an existing ora instance (immutable vs mutable). |
@sindresorhus I wait for your final word on this. Pros:
Cons:
|
@ngocdaothanh It's not a "mess". It's just a tiny API quirk. And I don't think immutability would solve any problems in this case (I'm saying that as someone that loves immutability in other languages). |
@stroncium I'm gonna go with "special case for empty string". Thinking about it more, it doesn't look like a special-case to me, but more like expected behavior. As long as we document it it, there should be no problems with this. Can you also give the PR a descriptive title? |
@sindresorhus changed to handle empty string |
prefixText
when it's an empty string
Fixes #122