MCPcopy Index your code
hub / github.com/Effect-TS/effect / toggle

Function toggle

packages/cli/src/internal/prompt/toggle.ts:153–165  ·  view source on GitHub ↗
(options: Prompt.Prompt.ToggleOptions)

Source from the content-addressed store, hash-verified

151
152/** @internal */
153export const toggle = (options: Prompt.Prompt.ToggleOptions): Prompt.Prompt<boolean> => {
154 const opts: ToggleOptions = {
155 initial: false,
156 active: "on",
157 inactive: "off",
158 ...options
159 }
160 return InternalPrompt.custom(opts.initial, {
161 render: handleRender(opts),
162 process: handleProcess,
163 clear: () => handleClear(opts)
164 })
165}

Callers

nothing calls this directly

Calls 2

handleRenderFunction · 0.70
handleClearFunction · 0.70

Tested by

no test coverage detected