Extract camelCase flag name from an OptionDef.flag string, e.g. '--max-tokens ' → 'maxTokens'
(def: OptionDef)
| 7 | |
| 8 | /** Extract camelCase flag name from an OptionDef.flag string, e.g. '--max-tokens <n>' → 'maxTokens' */ |
| 9 | function flagKey(def: OptionDef): string | null { |
| 10 | const m = def.flag.match(/^--([a-z][a-z0-9-]*)/i); |
| 11 | return m ? kebabToCamel(m[1]!) : null; |
| 12 | } |
| 13 | |
| 14 | /** Boolean when no value placeholder and type is not string/number/array */ |
| 15 | function isBooleanDef(def: OptionDef): boolean { |
no test coverage detected