Skip to content

Commit

Permalink
Merge pull request #191 from aaron-hanson/fix-quality-option-validation
Browse files Browse the repository at this point in the history
Fix quality option validation, update npm script syntax, package-lock
  • Loading branch information
lokesh authored Jul 6, 2020
2 parents 1c70277 + 3d8a284 commit ec776e6
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ Thumbs.db
.sass-cache
Rakefile
rsync-exclude
node_modules
node_modules

.idea
4 changes: 1 addition & 3 deletions dist/color-thief.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function validateOptions(options) {
colorCount = Math.min(colorCount, 20);
}

if (typeof quality === 'undefined' || Number.isInteger(quality)) {
quality = 10;
} else if (quality < 1) {
if (typeof quality === 'undefined' || !Number.isInteger(quality) || quality < 1) {
quality = 10;
}

Expand Down
2 changes: 1 addition & 1 deletion dist/color-thief.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ec776e6

Please sign in to comment.