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

Function renderInput

packages/cli/src/internal/prompt/number.ts:57–64  ·  view source on GitHub ↗
(state: State, submitted: boolean)

Source from the content-addressed store, hash-verified

55}
56
57function renderInput(state: State, submitted: boolean) {
58 const annotation = Option.match(state.error, {
59 onNone: () => Ansi.combine(Ansi.underlined, Ansi.cyanBright),
60 onSome: () => Ansi.red
61 })
62 const value = state.value === "" ? Doc.empty : Doc.text(`${state.value}`)
63 return submitted ? value : Doc.annotate(value, annotation)
64}
65
66const NEWLINE_REGEX = /\r?\n/
67

Callers 1

renderOutputFunction · 0.70

Calls 3

combineMethod · 0.65
annotateMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…