-
Notifications
You must be signed in to change notification settings - Fork 62
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
fix: Colors can be stringified with expontential alphas, but cannot b… #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, and can you add a number of tests under the "invalid" section(s) that test a few invalid inputs? Such as 1e
, e
, 0e-
, etc.
index.js
Outdated
/** | ||
* scientific-notation regexp | ||
* [+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)? | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is unnecessary.
/** | |
* scientific-notation regexp | |
* [+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)? | |
*/ |
There's a compatibility issue. |
That's fine, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests for decimal notations as well? E.g. 127.88e4
, 0.2e3
, .1e-4
, etc. Right now only 1e..
is being tested.
I wanted to save the scientific notation regular expression in a variable (and then write a test case), and pass it to new Regexp to concatenate it with the previous regular expression, but it was a lot of escaping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to keep nitting but also add them for hsl
too please since they're two separate regexes.
Sorry, my food arrived right as I published and I got sidetracked. Quesadillas take priority in my life. Thanks for the PR, published as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Sorry if i destoy your fixes! Tell me if im totally lost, otherwise thanks!
bug source