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

Function renderPrompt

packages/effect/src/unstable/cli/Prompt.ts:2228–2246  ·  view source on GitHub ↗
(
  confirm: string,
  message: string,
  leadingSymbol: string,
  trailingSymbol: string,
  options?: RenderOptions | undefined
)

Source from the content-addressed store, hash-verified

2226}
2227
2228const renderPrompt = (
2229 confirm: string,
2230 message: string,
2231 leadingSymbol: string,
2232 trailingSymbol: string,
2233 options?: RenderOptions | undefined
2234) => {
2235 const prefix = leadingSymbol + " "
2236 const annotate = options?.plain === true
2237 ? (line: string) => line
2238 : annotateLine
2239 return Arr.match(message.split(NEWLINE_REGEXP), {
2240 onEmpty: () => prefix + " " + trailingSymbol + " " + confirm,
2241 onNonEmpty: (promptLines) => {
2242 const lines = Arr.map(promptLines, (line) => annotate(line))
2243 return prefix + lines.join("\n") + " " + trailingSymbol + " " + confirm
2244 }
2245 })
2246}
2247
2248const renderPrefix = (
2249 state: FileState,

Callers 8

renderConfirmOutputFunction · 0.85
renderDateOutputFunction · 0.85
handleFileClearFunction · 0.85
Prompt.tsFile · 0.85
renderNumberOutputFunction · 0.85
renderSelectOutputFunction · 0.85
renderAutoCompleteOutputFunction · 0.85
renderTextOutputFunction · 0.85

Calls 4

joinMethod · 0.80
annotateFunction · 0.50
splitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected