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

Function renderOutput

packages/cli/src/internal/prompt/number.ts:90–112  ·  view source on GitHub ↗
(
  state: State,
  leadingSymbol: Doc.AnsiDoc,
  trailingSymbol: Doc.AnsiDoc,
  options: IntegerOptions,
  submitted: boolean = false
)

Source from the content-addressed store, hash-verified

88}
89
90function renderOutput(
91 state: State,
92 leadingSymbol: Doc.AnsiDoc,
93 trailingSymbol: Doc.AnsiDoc,
94 options: IntegerOptions,
95 submitted: boolean = false
96) {
97 const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold)
98 const prefix = Doc.cat(leadingSymbol, Doc.space)
99 return Arr.match(options.message.split(/\r?\n/), {
100 onEmpty: () => Doc.hsep([prefix, trailingSymbol, renderInput(state, submitted)]),
101 onNonEmpty: (promptLines) => {
102 const lines = Arr.map(promptLines, (line) => annotateLine(line))
103 return prefix.pipe(
104 Doc.cat(Doc.nest(Doc.vsep(lines), 2)),
105 Doc.cat(Doc.space),
106 Doc.cat(trailingSymbol),
107 Doc.cat(Doc.space),
108 Doc.cat(renderInput(state, submitted))
109 )
110 }
111 })
112}
113
114function renderNextFrame(state: State, options: IntegerOptions) {
115 return Effect.gen(function*() {

Callers 2

renderNextFrameFunction · 0.70
renderSubmissionFunction · 0.70

Calls 5

splitMethod · 0.80
renderInputFunction · 0.70
annotateLineFunction · 0.70
mapMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…