( options: TextOptions, type: TextOptionsReq["type"] )
| 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 | |
| 3719 | const 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)) |
no test coverage detected
searching dependent graphs…