MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / parseMappedArgument

Function parseMappedArgument

scripts/cli-options.ts:20–40  ·  view source on GitHub ↗
(
  args: string[],
  index: number,
  parsed: Parsed,
  config: ParserConfig<Parsed, ValueKey, BooleanKey>,
)

Source from the content-addressed store, hash-verified

18};
19
20export 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
42function applyInlineValueOption<Parsed extends object, ValueKey extends keyof Parsed & string>(
43 arg: string,

Callers 2

parseArgumentFunction · 0.90

Calls 3

applyInlineValueOptionFunction · 0.85
applyBooleanOptionFunction · 0.85

Tested by

no test coverage detected