File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -564,7 +564,7 @@ function parse (args, opts) {
564
564
565
565
var key = keys [ keys . length - 1 ]
566
566
567
- var isTypeArray = checkAllAliases ( key , flags . arrays )
567
+ var isTypeArray = checkAllAliases ( keys . join ( '.' ) , flags . arrays )
568
568
var isValueArray = Array . isArray ( value )
569
569
var duplicate = configuration [ 'duplicate-arguments-array' ]
570
570
Original file line number Diff line number Diff line change @@ -2056,6 +2056,17 @@ describe('yargs-parser', function () {
2056
2056
2057
2057
parsed [ 'x' ] . should . deep . equal ( [ 'a' , 'b' ] )
2058
2058
} )
2059
+
2060
+ it ( 'flattens duplicate array type, when argument uses dot notation' , function ( ) {
2061
+ var parsed = parser ( '-x.foo a -x.foo b' , {
2062
+ array : [ 'x.foo' ] ,
2063
+ configuration : {
2064
+ 'flatten-duplicate-arrays' : true
2065
+ }
2066
+ } )
2067
+
2068
+ parsed [ 'x' ] . should . deep . equal ( { foo : [ 'a' , 'b' ] } )
2069
+ } )
2059
2070
} )
2060
2071
2061
2072
describe ( 'duplicate-arguments-array VS flatten-duplicate-arrays' , function ( ) {
You can’t perform that action at this time.
0 commit comments