( nextState: TextState, pointer: string, theme: Theme, renderOptions?: RenderOptions | undefined )
| 3792 | } |
| 3793 | |
| 3794 | const renderTextError = ( |
| 3795 | nextState: TextState, |
| 3796 | pointer: string, |
| 3797 | theme: Theme, |
| 3798 | renderOptions?: RenderOptions | undefined |
| 3799 | ): string => { |
| 3800 | if (Option.isSome(nextState.error)) { |
| 3801 | return Arr.match(nextState.error.value.split(NEWLINE_REGEXP), { |
| 3802 | onEmpty: () => "", |
| 3803 | onNonEmpty: (errorLines) => { |
| 3804 | if (renderOptions?.plain === true) { |
| 3805 | return separateSymbol(pointer, errorLines.join("\n")) |
| 3806 | } |
| 3807 | const prefix = annotateSymbol(theme, pointer, theme.errorColor) |
| 3808 | const lines = Arr.map(errorLines, (str) => annotateErrorLine(theme, str)) |
| 3809 | return Ansi.cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + Ansi.cursorRestorePosition |
| 3810 | } |
| 3811 | }) |
| 3812 | } |
| 3813 | return "" |
| 3814 | } |
| 3815 | |
| 3816 | const renderTextOutput = ( |
| 3817 | nextState: TextState, |
no test coverage detected