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

Function handleNumberClear

packages/effect/src/unstable/cli/Prompt.ts:2763–2774  ·  view source on GitHub ↗
(options: IntegerOptionsReq)

Source from the content-addressed store, hash-verified

2761}
2762
2763const handleNumberClear = (options: IntegerOptionsReq) => {
2764 return Effect.fnUntraced(function*(state: NumberState, _: Action<NumberState, number>) {
2765 const terminal = yield* Terminal.Terminal
2766 const columns = yield* terminal.columns
2767 const figures = yield* platformFigures
2768 const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft
2769 const errorText = renderNumberError(state, figures.pointerSmall, { plain: true })
2770 const promptText = renderNumberOutput(state, "?", figures.pointerSmall, options, { plain: true })
2771 const clearOutput = clearOutputWithError(promptText, columns, errorText)
2772 return clearOutput + resetCurrentLine
2773 })
2774}
2775
2776const renderNumberInput = (
2777 state: NumberState,

Callers 2

floatFunction · 0.85
integerFunction · 0.85

Calls 3

renderNumberErrorFunction · 0.85
renderNumberOutputFunction · 0.85
clearOutputWithErrorFunction · 0.85

Tested by

no test coverage detected