MCPcopy Create free account
hub / github.com/Effect-TS/effect / basePrompt

Function basePrompt

packages/effect/src/unstable/cli/Prompt.ts:3739–3760  ·  view source on GitHub ↗
(
  options: TextOptions,
  type: TextOptionsReq["type"]
)

Source from the content-addressed store, hash-verified

3737}
3738
3739const basePrompt = (
3740 options: TextOptions,
3741 type: TextOptionsReq["type"]
3742): Prompt<string> => {
3743 const opts: TextOptionsReq = {
3744 default: "",
3745 type,
3746 validate: Effect.succeed,
3747 ...options
3748 }
3749
3750 const initialState: TextState = {
3751 cursor: opts.default.length,
3752 value: opts.default,
3753 error: Option.none()
3754 }
3755 return custom(initialState, {
3756 render: handleTextRender(opts),
3757 process: handleTextProcess(opts),
3758 clear: handleTextClear(opts)
3759 })
3760}
3761
3762interface ToggleOptionsReq extends Required<ToggleOptions> {}
3763

Callers 3

hiddenFunction · 0.85
passwordFunction · 0.85
textFunction · 0.85

Calls 4

handleTextRenderFunction · 0.85
handleTextProcessFunction · 0.85
handleTextClearFunction · 0.85
customFunction · 0.70

Tested by

no test coverage detected