File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -470,7 +470,9 @@ function parse (args, opts) {
470
470
if ( typeof val === 'string' ) val = val === 'true'
471
471
}
472
472
473
- var value = maybeCoerceNumber ( key , val )
473
+ var value = Array . isArray ( val )
474
+ ? val . map ( function ( v ) { return maybeCoerceNumber ( key , v ) } )
475
+ : maybeCoerceNumber ( key , val )
474
476
475
477
// increment a count given as arg (either no value or value parsed as boolean)
476
478
if ( checkAllAliases ( key , flags . counts ) && ( isUndefined ( value ) || typeof value === 'boolean' ) ) {
@@ -486,7 +488,7 @@ function parse (args, opts) {
486
488
}
487
489
488
490
function maybeCoerceNumber ( key , value ) {
489
- if ( ! checkAllAliases ( key , flags . strings ) ) {
491
+ if ( ! checkAllAliases ( key , flags . strings ) && ! checkAllAliases ( key , flags . bools ) && ! Array . isArray ( value ) ) {
490
492
const shouldCoerceNumber = isNumber ( value ) && configuration [ 'parse-numbers' ] && (
491
493
Number . isSafeInteger ( Math . floor ( value ) )
492
494
)
You can’t perform that action at this time.
0 commit comments