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

Function renderOutput

packages/cli/src/internal/prompt/date.ts:89–110  ·  view source on GitHub ↗
(
  leadingSymbol: Doc.AnsiDoc,
  trailingSymbol: Doc.AnsiDoc,
  parts: Doc.AnsiDoc,
  options: DateOptions
)

Source from the content-addressed store, hash-verified

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

Callers 2

renderNextFrameFunction · 0.70
renderSubmissionFunction · 0.70

Calls 4

splitMethod · 0.80
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…