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

Function renderToggle

packages/effect/src/unstable/cli/Prompt.ts:3777–3791  ·  view source on GitHub ↗
(
  value: boolean,
  options: ToggleOptionsReq,
  submitted: boolean = false
)

Source from the content-addressed store, hash-verified

3775})
3776
3777const renderToggle = (
3778 value: boolean,
3779 options: ToggleOptionsReq,
3780 submitted: boolean = false
3781) => {
3782 const separator = Ansi.annotate("/", Ansi.blackBright)
3783 const selectedAnnotation = Ansi.combine(Ansi.underlined, submitted ? Ansi.white : Ansi.cyanBright)
3784 const inactive = value
3785 ? options.inactive
3786 : Ansi.annotate(options.inactive, selectedAnnotation)
3787 const active = value
3788 ? Ansi.annotate(options.active, selectedAnnotation)
3789 : options.active
3790 return active + " " + separator + " " + inactive
3791}
3792
3793const renderToggleOutput = (
3794 toggle: string,

Callers 1

Prompt.tsFile · 0.85

Calls 2

annotateMethod · 0.65
combineMethod · 0.65

Tested by

no test coverage detected