MCPcopy Index your code
hub / github.com/Waishnav/devspace / textPrompt

Function textPrompt

src/cli.ts:309–317  ·  view source on GitHub ↗
(options: TextPromptOptions)

Source from the content-addressed store, hash-verified

307};
308
309async function textPrompt(options: TextPromptOptions): Promise<string> {
310 const result = await prompts.text({
311 ...options,
312 validate: (value) => options.validate?.(value?.trim() ? value : options.defaultValue),
313 });
314 if (prompts.isCancel(result)) throw new SetupCancelledError();
315 const value = String(result).trim();
316 return value || options.defaultValue;
317}
318
319function validatePort(value: string | undefined): string | undefined {
320 const port = Number(value);

Callers 1

runInitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected