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

Function validate

packages/prompts/src/group-multi-select.ts:211–223  ·  view source on GitHub ↗
(selected: Value[] | undefined)

Source from the content-addressed store, hash-verified

209 cursorAt: opts.cursorAt,
210 selectableGroups,
211 validate(selected: Value[] | undefined) {
212 if (required && (selected === undefined || selected.length === 0))
213 return `Please select at least one option.\n${styleText(
214 'reset',
215 styleText(
216 'dim',
217 `Press ${styleText(['gray', 'bgWhite', 'inverse'], ' space ')} to select, ${styleText(
218 'gray',
219 styleText(['bgWhite', 'inverse'], ' enter ')
220 )} to submit`
221 )
222 )}`;
223 },
224 render() {
225 const hasGuide = opts.withGuide ?? settings.withGuide;
226 const title = `${hasGuide ? `${styleText('gray', S_BAR)}\n` : ''}${symbol(this.state)} ${opts.message}\n`;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected