( args: string[], index: number, parsed: Parsed, config: ParserConfig<Parsed, ValueKey, BooleanKey>, )
| 18 | }; |
| 19 | |
| 20 | export function parseMappedArgument< |
| 21 | Parsed extends object, |
| 22 | ValueKey extends keyof Parsed & string, |
| 23 | BooleanKey extends keyof Parsed & string, |
| 24 | >( |
| 25 | args: string[], |
| 26 | index: number, |
| 27 | parsed: Parsed, |
| 28 | config: ParserConfig<Parsed, ValueKey, BooleanKey>, |
| 29 | ) { |
| 30 | const arg = args[index]; |
| 31 | |
| 32 | if (applyInlineValueOption(arg, parsed, config.inlineValueOptions)) { |
| 33 | return index; |
| 34 | } |
| 35 | if (applyBooleanOption(arg, parsed, config.booleanOptions)) { |
| 36 | return index; |
| 37 | } |
| 38 | |
| 39 | return applyValueOrPositionalOption(args, index, parsed, config, arg); |
| 40 | } |
| 41 | |
| 42 | function applyInlineValueOption<Parsed extends object, ValueKey extends keyof Parsed & string>( |
| 43 | arg: string, |
no test coverage detected