MCPcopy Create free account
hub / github.com/effect-app/libs / basePrompt

Function basePrompt

repos/effect/packages/effect/src/unstable/cli/Prompt.ts:3709–3730  ·  view source on GitHub ↗
(
  options: TextOptions,
  type: TextOptionsReq["type"]
)

Source from the content-addressed store, hash-verified

3707 case "hidden": {
3708 return ""
3709 }
3710 case "password": {
3711 return annotateSymbol(theme.passwordMask.repeat(text.length), annotation)
3712 }
3713 case "text": {
3714 return Ansi.annotate(text, annotation)
3715 }
3716 }
3717}
3718
3719const renderTextError = (
3720 nextState: TextState,
3721 pointer: string,
3722 theme: Theme,
3723 renderOptions?: RenderOptions | undefined
3724): string => {
3725 if (Option.isSome(nextState.error)) {
3726 return Arr.match(nextState.error.value.split(NEWLINE_REGEXP), {
3727 onEmpty: () => "",
3728 onNonEmpty: (errorLines) => {
3729 if (renderOptions?.plain === true) {
3730 return separateSymbol(pointer, errorLines.join("\n"))
3731 }
3732 const prefix = annotateSymbol(pointer, theme.errorColor)
3733 const lines = Arr.map(errorLines, (str) => annotateErrorLine(str, theme.errorColor))

Callers 3

hiddenFunction · 0.85
passwordFunction · 0.85
textFunction · 0.85

Calls 4

handleTextRenderFunction · 0.85
handleTextProcessFunction · 0.85
handleTextClearFunction · 0.85
customFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…