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 @@ -117,10 +117,9 @@ class Benchmark {
117117 const [ , key , value ] = match ;
118118 if ( configs [ key ] !== undefined ) {
119119 cliOptions [ key ] ||= [ ] ;
120- cliOptions [ key ] . push (
121- // Infer the type from the config object and parse accordingly
122- typeof configs [ key ] [ 0 ] === 'number' ? + value : value ,
123- ) ;
120+ const configType = typeof configs [ key ] [ 0 ] ;
121+ const configValue = configType === 'number' ? + value : configType === 'boolean' ? value === 'true' : value ;
122+ cliOptions [ key ] . push ( configValue ) ;
124123 } else {
125124 extraOptions [ key ] = value ;
126125 }
@@ -140,7 +139,7 @@ class Benchmark {
140139 const values = options [ key ] ;
141140
142141 for ( const value of values ) {
143- if ( typeof value !== 'number' && typeof value !== 'string' ) {
142+ if ( typeof value !== 'number' && typeof value !== 'string' && typeof value !== 'boolean' ) {
144143 throw new TypeError (
145144 `configuration "${ key } " had type ${ typeof value } ` ) ;
146145 }
You can’t perform that action at this time.
0 commit comments