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

Function renderToggleOutput

packages/effect/src/unstable/cli/Prompt.ts:3793–3806  ·  view source on GitHub ↗
(
  toggle: string,
  leadingSymbol: string,
  trailingSymbol: string,
  options: ToggleOptionsReq
)

Source from the content-addressed store, hash-verified

3791}
3792
3793const renderToggleOutput = (
3794 toggle: string,
3795 leadingSymbol: string,
3796 trailingSymbol: string,
3797 options: ToggleOptionsReq
3798) => {
3799 const promptLines = options.message.split(NEWLINE_REGEXP)
3800 const prefix = leadingSymbol + " "
3801 if (Arr.isReadonlyArrayNonEmpty(promptLines)) {
3802 const lines = Arr.map(promptLines, (line) => annotateLine(line))
3803 return prefix + lines.join("\n") + " " + trailingSymbol + " " + toggle
3804 }
3805 return prefix + " " + trailingSymbol + " " + toggle
3806}
3807
3808const renderToggleNextFrame = Effect.fnUntraced(function*(state: ToggleState, options: ToggleOptionsReq) {
3809 const figures = yield* platformFigures

Callers 1

Prompt.tsFile · 0.85

Calls 4

annotateLineFunction · 0.85
joinMethod · 0.80
splitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected