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

Function applyInlineValueOption

scripts/cli-options.ts:42–54  ·  view source on GitHub ↗
(
  arg: string,
  parsed: Parsed,
  inlineOptions: Array<InlineValueOption<ValueKey>>,
)

Source from the content-addressed store, hash-verified

40}
41
42function 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
56function applyBooleanOption<Parsed extends object, BooleanKey extends keyof Parsed & string>(
57 arg: string,

Callers 1

parseMappedArgumentFunction · 0.85

Calls 1

findMethod · 0.65

Tested by

no test coverage detected