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

Function handleNumberClear

packages/effect/src/cli/Prompt.ts:2986–2999  ·  view source on GitHub ↗
(options: IntOptionsReq)

Source from the content-addressed store, hash-verified

2984}
2985
2986const handleNumberClear = (options: IntOptionsReq) => {
2987 return Effect.fnUntraced(function*(state: NumberState, _: Action<NumberState, number>) {
2988 const terminal = yield* Terminal.Terminal
2989 const columns = yield* terminal.columns
2990 const figures = yield* getTheme(options)
2991 const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft
2992 const errorText = renderNumberError(state, figures.pointerSmall, figures, { plain: true })
2993 const promptText = renderNumberOutput(state, figures.prefix, figures.pointerSmall, options, figures, {
2994 plain: true
2995 })
2996 const clearOutput = clearOutputWithError(promptText, columns, errorText)
2997 return clearOutput + resetCurrentLine
2998 })
2999}
3000
3001const renderNumberInput = (
3002 state: NumberState,

Callers 2

NumberFunction · 0.85
IntFunction · 0.85

Calls 4

getThemeFunction · 0.85
renderNumberErrorFunction · 0.85
renderNumberOutputFunction · 0.85
clearOutputWithErrorFunction · 0.85

Tested by

no test coverage detected