| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2d23968 commit 91127c9
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -118,10 +118,9 @@ class Benchmark { | |||
| 118 | 118 | const [, key, value] = match; | |
| 119 | 119 | if (configs[key] !== undefined) { | |
| 120 | 120 | 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); | ||
| 125 | 124 | } else { | |
| 126 | 125 | extraOptions[key] = value; | |
| 127 | 126 | } | |
@@ -141,7 +140,7 @@ class Benchmark { | |||
| 141 | 140 | const values = options[key]; | |
| 142 | 141 | ||
| 143 | 142 | for (const value of values) { | |
| 144 | - if (typeof value !== 'number' && typeof value !== 'string') { | ||
| 143 | + if (typeof value !== 'number' && typeof value !== 'string' && typeof value !== 'boolean') { | ||
| 145 | 144 | throw new TypeError( | |
| 146 | 145 | `configuration "${key}" had type ${typeof value}`); | |
| 147 | 146 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments