Closed gilbert closed 5 months ago
It's not "larger than 32 bits", it's "larger than Number.MAX_SAFE_INTEGER
" - and that's just the nature of JavaScript.
Related, I did some work on this in #18 (as I knew an issue had been reported on the original Minimist repository).
Did this affect something you were using Minimist for @gilbert , or rather you found the possibility of a lossy conversion?
The work-around for a false positive with a string of digits being inappropriately converted to a number is to specify the option is a string. This can also be done for positionals: #52.
This code parses all number-looking values as numbers. However, if the number is too large, it gets parsed as a different number. For example,
1735778230747959786
is parsed as1735778230747959800
.