dthree / dthree/vorpal

Number-like args incorrectly parsed by Minimist

Open
#263 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.6k
Forks
278
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.