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

Function renderNumberInput

packages/effect/src/unstable/cli/Prompt.ts:2776–2789  ·  view source on GitHub ↗
(
  state: NumberState,
  submitted: boolean,
  renderOptions?: RenderOptions | undefined
)

Source from the content-addressed store, hash-verified

2774}
2775
2776const renderNumberInput = (
2777 state: NumberState,
2778 submitted: boolean,
2779 renderOptions?: RenderOptions | undefined
2780): string => {
2781 const value = state.value === "" ? "" : `${state.value}`
2782 if (submitted || renderOptions?.plain === true) {
2783 return value
2784 }
2785 const annotation = Option.isSome(state.error) ?
2786 Ansi.red :
2787 Ansi.combine(Ansi.underlined, Ansi.cyanBright)
2788 return Ansi.annotate(value, annotation)
2789}
2790
2791const renderNumberError = (
2792 state: NumberState,

Callers 1

renderNumberOutputFunction · 0.85

Calls 2

combineMethod · 0.65
annotateMethod · 0.65

Tested by

no test coverage detected