File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -118,10 +118,9 @@ class Benchmark {
118118 const [ , key , value ] = match ;
119119 if ( configs [ key ] !== undefined ) {
120120 cliOptions [ key ] ||= [ ] ;
121- cliOptions [ key ] . push (
122- // Infer the type from the config object and parse accordingly
123- typeof configs [ key ] [ 0 ] === 'number' ? + value : value ,
124- ) ;
121+ const configType = typeof configs [ key ] [ 0 ] ;
122+ const configValue = configType === 'number' ? + value : configType === 'boolean' ? value === 'true' : value ;
123+ cliOptions [ key ] . push ( configValue ) ;
125124 } else {
126125 extraOptions [ key ] = value ;
127126 }
@@ -141,7 +140,7 @@ class Benchmark {
141140 const values = options [ key ] ;
142141
143142 for ( const value of values ) {
144- if ( typeof value !== 'number' && typeof value !== 'string' ) {
143+ if ( typeof value !== 'number' && typeof value !== 'string' && typeof value !== 'boolean' ) {
145144 throw new TypeError (
146145 `configuration "${ key } " had type ${ typeof value } ` ) ;
147146 }
You can’t perform that action at this time.
0 commit comments