MCPcopy
hub / github.com/github/awesome-copilot / setSelectValues

Function setSelectValues

website/src/scripts/pages/select-utils.ts:6–12  ·  view source on GitHub ↗
(select: HTMLSelectElement | null, values: string[])

Source from the content-addressed store, hash-verified

4}
5
6export function setSelectValues(select: HTMLSelectElement | null, values: string[]): void {
7 if (!select) return;
8 const selected = new Set(values);
9 Array.from(select.options).forEach((option) => {
10 option.selected = selected.has(option.value);
11 });
12}
13
14export function clearSelectValues(select: HTMLSelectElement | null): void {
15 if (!select) return;

Callers 4

initInstructionsPageFunction · 0.90
initWorkflowsPageFunction · 0.90
initHooksPageFunction · 0.90
initPluginsPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected