Closed meszaros-lajos-gyorgy closed 2 years ago
I believe you can take the solution from this PR: https://github.com/substack/minimist/pull/150
Added the fix and released a new version: https://github.com/meszaros-lajos-gyorgy/minimist-lite/releases/tag/v2.0.1
Original issue by @dimabru at https://github.com/substack/minimist/issues/149
Hex
parameters get auto-converted to numbers. This results in a loss of information and change of values sincehex
values often exceed max int.example: input args
--a 0xffffffffffffffffffff
code:
console.log(process.argv.slice(2));
let args = minimist(process.argv.slice(2));
console.log(args['a']);
console.log(args['a'].toString(16));
console output:
100000000000000000000
is clearly !==0xffffffffffffffffffff