( state: NumberState, pointer: string, renderOptions?: RenderOptions | undefined )
| 2789 | } |
| 2790 | |
| 2791 | const renderNumberError = ( |
| 2792 | state: NumberState, |
| 2793 | pointer: string, |
| 2794 | renderOptions?: RenderOptions | undefined |
| 2795 | ) => { |
| 2796 | if (Option.isSome(state.error)) { |
| 2797 | return Arr.match(state.error.value.split(NEWLINE_REGEXP), { |
| 2798 | onEmpty: () => "", |
| 2799 | onNonEmpty: (errorLines) => { |
| 2800 | if (renderOptions?.plain === true) { |
| 2801 | return `${pointer} ${errorLines.join("\n")}` |
| 2802 | } |
| 2803 | const prefix = Ansi.annotate(pointer, Ansi.red) + " " |
| 2804 | const lines = Arr.map(errorLines, (str) => annotateErrorLine(str)) |
| 2805 | return Ansi.cursorSavePosition + "\n" + prefix + lines.join("\n") + Ansi.cursorRestorePosition |
| 2806 | } |
| 2807 | }) |
| 2808 | } |
| 2809 | return "" |
| 2810 | } |
| 2811 | |
| 2812 | const renderNumberOutput = ( |
| 2813 | state: NumberState, |
no test coverage detected