Skip to content
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

Refactor: add color type helper #625

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

thadeucity
Copy link

A color object type is being checked the same way in 3 parts of the code. hslToColorString.js , rgbToColorString.js and toColorString.js. To simplify its use and also reduce the lib size, a helper function was created to identify the color object type.

The refactoring reduced the lib size by approximately 0.7% (Gziped) It is a marginal gain, but I believe any size improvement is a welcome one.

Add a color type helper to identify obj type and reduce code repetition
@codecov
Copy link

codecov bot commented Oct 30, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (a7e3dee) to head (108c170).

❗ Current head 108c170 differs from pull request most recent head 019893c. Consider uploading reports for the commit 019893c to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #625   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           89        90    +1     
  Lines          860       847   -13     
  Branches       323       301   -22     
=========================================
- Hits           860       847   -13     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants