Remove unnecessary step with number separator from Color function #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@Qix- I'm sorry that my comment https://github.com/Qix-/color/issues/204#issuecomment-889933878 came across as demanding and thankless. I'll try to be more constructive and look for a solution that is aligned with your aims of this project. What do you think about the change in this PR? Unlike transpiling, it should AFAIK not add any maintenance cost.
AFAIK
object &= 0xFF_FF_FF;
was an unnecessary step, becauseobject & 0xFF
is equivalent toobject & 0xFF_FF_FF & 0xFF
and(object >> 16) & 0xFF
is equivalent to((object & 0xFF_FF_FF) >> 16) & 0xFF
This should prevent the error described in https://github.com/Qix-/color/issues/204
There is just one more place that would throw a similar error:
color/index.js
Line 257 in 694d197
Note that I don't have anything against ESM. I have read through https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c that you recommended and I didn't find there anything about ECMAScript 2021 features (such as Numeric separators). I'm using ESM in my code that is built/compiled with https://cli.vuejs.org/. It also works well with ESM in NPM dependencies that use the
package.json
module
field. The only thing that is causing issues is ES2021 numeric separators.