ralscha/bread-compressor-cli

All CLI number options are incorrectly parsed.

Closed this issue · 1 comments

This problem may be caused by upgrading of dependency "commander" which now passes multiple parameters to custom parse function.

Unlike parseFloat which accepts only 1 parameter, parseInt accepts second parameter radix.

So use of global parseInt as custom parse function is unsafe, a quick fix is to use a local parseInt function which will only accept 1 parameter.

index.js:12

function parseArgs() {
    let parseInt = (s) => Number.parseInt(s);
    //...
}

Thanks a lot for the report. Released 3.1.0 with this fix