| 1568 | } |
| 1569 | |
| 1570 | const renderDateError = (state: DateState, pointer: string): string => { |
| 1571 | if (Option.isSome(state.error)) { |
| 1572 | const errorLines = state.error.value.split(NEWLINE_REGEXP) |
| 1573 | if (Arr.isReadonlyArrayNonEmpty(errorLines)) { |
| 1574 | const prefix = Ansi.annotate(pointer, Ansi.red) + " " |
| 1575 | const lines = Arr.map(errorLines, (str) => annotateErrorLine(str)) |
| 1576 | return Ansi.cursorSavePosition + "\n" + prefix + lines.join("\n") + Ansi.cursorRestorePosition |
| 1577 | } |
| 1578 | } |
| 1579 | return "" |
| 1580 | } |
| 1581 | |
| 1582 | const renderParts = (state: DateState, submitted: boolean = false) => { |
| 1583 | return Arr.reduce( |