MCPcopy Create free account
hub / github.com/bombshell-dev/clack / styleOption

Function styleOption

packages/prompts/src/multi-select.ts:119–131  ·  view source on GitHub ↗
(option: Option<Value>, active: boolean)

Source from the content-addressed store, hash-verified

117 const value = this.value ?? [];
118
119 const styleOption = (option: Option<Value>, active: boolean) => {
120 if (option.disabled) {
121 return opt(option, 'disabled');
122 }
123 const selected = value.includes(option.value);
124 if (active && selected) {
125 return opt(option, 'active-selected');
126 }
127 if (selected) {
128 return opt(option, 'selected');
129 }
130 return opt(option, active ? 'active' : 'inactive');
131 };
132
133 switch (this.state) {
134 case 'submit': {

Callers

nothing calls this directly

Calls 1

optFunction · 0.70

Tested by

no test coverage detected