MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / selectMany

Function selectMany

src/cli/interactive/prompts.ts:39–54  ·  view source on GitHub ↗
(opts: {
      options: SelectOption<T>[];
      initialSelectedKeys?: ReadonlySet<string>;
      getKey: (value: T) => string;
      minSelected?: number;
    })

Source from the content-addressed store, hash-verified

37 return opts.options[index].value;
38 },
39 async selectMany<T>(opts: {
40 options: SelectOption<T>[];
41 initialSelectedKeys?: ReadonlySet<string>;
42 getKey: (value: T) => string;
43 minSelected?: number;
44 }): Promise<T[]> {
45 const selected = opts.options.filter((option) =>
46 (opts.initialSelectedKeys ?? new Set<string>()).has(opts.getKey(option.value)),
47 );
48 if (selected.length > 0) {
49 return selected.map((option) => option.value);
50 }
51
52 const minSelected = opts.minSelected ?? 0;
53 return opts.options.slice(0, minSelected).map((option) => option.value);
54 },
55 async confirm(opts: { defaultValue: boolean }): Promise<boolean> {
56 return opts.defaultValue;
57 },

Callers

nothing calls this directly

Calls 1

handleCancelFunction · 0.85

Tested by

no test coverage detected