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 @@ -115,10 +115,9 @@ class Benchmark {
115115 const [ , key , value ] = match ;
116116 if ( configs [ key ] !== undefined ) {
117117 cliOptions [ key ] ||= [ ] ;
118- cliOptions [ key ] . push (
119- // Infer the type from the config object and parse accordingly
120- typeof configs [ key ] [ 0 ] === 'number' ? + value : value ,
121- ) ;
118+ const configType = typeof configs [ key ] [ 0 ] ;
119+ const configValue = configType === 'number' ? + value : configType === 'boolean' ? value === 'true' : value ;
120+ cliOptions [ key ] . push ( configValue ) ;
122121 } else {
123122 extraOptions [ key ] = value ;
124123 }
@@ -138,7 +137,7 @@ class Benchmark {
138137 const values = options [ key ] ;
139138
140139 for ( const value of values ) {
141- if ( typeof value !== 'number' && typeof value !== 'string' ) {
140+ if ( typeof value !== 'number' && typeof value !== 'string' && typeof value !== 'boolean' ) {
142141 throw new TypeError (
143142 `configuration "${ key } " had type ${ typeof value } ` ) ;
144143 }
You can’t perform that action at this time.
0 commit comments