MCPcopy Index your code
hub / github.com/bombshell-dev/clack / validate

Function validate

packages/prompts/src/path.ts:68–80  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

66 initialUserInput: opts.initialValue ?? opts.root ?? process.cwd(),
67 maxItems: 5,
68 validate(value) {
69 if (Array.isArray(value)) {
70 // Shouldn't ever happen since we don't enable `multiple: true`
71 return undefined;
72 }
73 if (!value) {
74 return 'Please select a path';
75 }
76 if (validate) {
77 return runValidation(validate, value);
78 }
79 return undefined;
80 },
81 options() {
82 const userInput = this.userInput;
83 if (userInput === '') {

Callers

nothing calls this directly

Calls 1

runValidationFunction · 0.90

Tested by

no test coverage detected