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

fix(string-utils): detect [0,1] ranged values as numbers #388

merged 5 commits into from Jun 20, 2021


Copy link

@antongolub antongolub commented May 29, 2021

closes #389

This PR brings back detection regular decimal fractional numbers (0.1, 0.0313) as numbers.


imagemin-cli %  ./cli.js --plugin.pngquant.quality={0.1,1} foo.png
  pngquant: { quality: [ '0.1', 1 ] },
  foo: { bar: '0.2' }


imagemin-cli %  ./cli.js --plugin.pngquant.quality={0.1,1} foo
  pngquant: { quality: [ 0.1, 1 ] },
  foo: { bar: 0.2 }

@antongolub antongolub changed the title fix(string-utils): detect 0.1 as a number like fix(string-utils): detect [0,1] ranged values as numbers May 30, 2021
Copy link
Contributor Author

@bcoe, could you take a look?

Copy link

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I would like to test against yargs' suite.

Copy link

bcoe commented Jun 20, 2021

@antongolub thank you for the contribution, works great with yargs.

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

Successfully merging this pull request may close these issues.

bug: numeric values in [0, 1] range are not detected as numbers
2 participants