vorpal icon indicating copy to clipboard operation
vorpal copied to clipboard

Number-like args incorrectly parsed by Minimist

Open mathiscode opened this issue 8 years ago • 0 comments
trafficstars

When using arguments such as a hex string that could be interpreted as a numeric value:

mycommand 23782e8821

In lib/util.js, when that argument gets passed to minimist in the parseArgs function, minimist interprets this as a number and returns Infinity.

This is really more of a problem with minimist, but since it no longer appears to be maintained, there should be a solution implemented within Vorpal. Although static types can be assigned for options, this is not so for args.

I will be submitting a PR shortly with a workaround, which tests arguments passed to minimist, and if they are Infinity, it will revert them to the raw value provided before parsing via minimist.

mathiscode avatar Jul 03 '17 13:07 mathiscode