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

Function validate

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

Source from the content-addressed store, hash-verified

93 required,
94 cursorAt: opts.cursorAt,
95 validate(selected: Value[] | undefined) {
96 if (required && (selected === undefined || selected.length === 0))
97 return `Please select at least one option.\n${styleText(
98 'reset',
99 styleText(
100 'dim',
101 `Press ${styleText(['gray', 'bgWhite', 'inverse'], ' space ')} to select, ${styleText(
102 'gray',
103 styleText('bgWhite', styleText('inverse', ' enter '))
104 )} to submit`
105 )
106 )}`;
107 },
108 render() {
109 const hasGuide = opts.withGuide ?? settings.withGuide;
110 const wrappedMessage = wrapTextWithPrefix(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected