-
Notifications
You must be signed in to change notification settings - Fork 439
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
Potential toString vs getOriginalInput confusion #77
Comments
So the review suggestion is that
Did you have anything in mind? |
@bgrins It just seems like |
Given that rule, I see:
How about given this input?
|
In Brackets, we have a preference for uppercase if that's true, then it's converted to UPPER, otherwise conversions use lower. So, my biased opinion :) would be that if all alpha chars in original are uppercase use UPPER, otherwise lower.
|
What about adding another parameter to |
It's the API design that I'm struggling with here. I'm afraid implementing this behavior by default in There could be an extra param to Also, this could be implemented easily outside of the library:
or
|
I guess maybe not that easy - it would also need to make sure that getOriginalInput is a string before calling toUppercase. But I guess in the case of object input it should default to lower. |
I had something initially very similar to your examples implemented in the code. It might be better for it to be done that way anyway. I reported this as it was a source of confusion for both me and @redmunds, and I didn't know if this would be something you'd be interested in. |
@bgrins No worries. Thanks for listening to my opinion. |
In having adobe/brackets#9596 reviewed, @redmunds brought out an interesting observation:
I am wondering what your thoughts are on this, @bgrins. I know
toString()
is a long-standing method and removing/renaming it would be a huge breaking change, but would it be possible to better document the normalization it performs and/or renamegetOriginalInput()
to something that better describes it's actions vstoString()
? I mention renaming as it is a very recent edition to TinyColor and probably isn't used much yet.The text was updated successfully, but these errors were encountered: