( arg: string, parsed: Parsed, inlineOptions: Array<InlineValueOption<ValueKey>>, )
| 40 | } |
| 41 | |
| 42 | function applyInlineValueOption<Parsed extends object, ValueKey extends keyof Parsed & string>( |
| 43 | arg: string, |
| 44 | parsed: Parsed, |
| 45 | inlineOptions: Array<InlineValueOption<ValueKey>>, |
| 46 | ) { |
| 47 | const option = inlineOptions.find((candidate) => arg.startsWith(candidate.prefix)); |
| 48 | if (!option) { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | parsed[option.key] = arg.slice(option.prefix.length) as Parsed[ValueKey]; |
| 53 | return true; |
| 54 | } |
| 55 | |
| 56 | function applyBooleanOption<Parsed extends object, BooleanKey extends keyof Parsed & string>( |
| 57 | arg: string, |
no test coverage detected