( state: MultiSelectState, pointer: string, renderOptions?: RenderOptions | undefined )
| 2514 | } |
| 2515 | |
| 2516 | const renderMultiSelectError = ( |
| 2517 | state: MultiSelectState, |
| 2518 | pointer: string, |
| 2519 | renderOptions?: RenderOptions | undefined |
| 2520 | ): string => { |
| 2521 | if (Option.isSome(state.error)) { |
| 2522 | return Arr.match(state.error.value.split(NEWLINE_REGEXP), { |
| 2523 | onEmpty: () => "", |
| 2524 | onNonEmpty: (errorLines) => { |
| 2525 | if (renderOptions?.plain === true) { |
| 2526 | return `${pointer} ${errorLines.join("\n")}` |
| 2527 | } |
| 2528 | const prefix = Ansi.annotate(pointer, Ansi.red) + " " |
| 2529 | const lines = Arr.map(errorLines, (str) => annotateErrorLine(str)) |
| 2530 | return Ansi.cursorSavePosition + "\n" + prefix + lines.join("\n") + Ansi.cursorRestorePosition |
| 2531 | } |
| 2532 | }) |
| 2533 | } |
| 2534 | return "" |
| 2535 | } |
| 2536 | |
| 2537 | const renderChoiceDescription = <A>( |
| 2538 | choice: SelectChoice<A>, |
no test coverage detected