(options: DateOptionsReq)
| 1549 | } |
| 1550 | |
| 1551 | const handleDateClear = (options: DateOptionsReq) => { |
| 1552 | return Effect.fnUntraced(function*(state: DateState, _: Action<DateState, globalThis.Date>) { |
| 1553 | const terminal = yield* Terminal.Terminal |
| 1554 | const columns = yield* terminal.columns |
| 1555 | const figures = yield* platformFigures |
| 1556 | const resetCurrentLine = Ansi.eraseLine + Ansi.cursorLeft |
| 1557 | const parts = Arr.reduce(state.dateParts, "", (doc, part) => doc + part.toString()) |
| 1558 | const promptText = renderDateOutput("?", figures.pointerSmall, parts, options, { plain: true }) |
| 1559 | const errorText = Option.isSome(state.error) |
| 1560 | ? Arr.match(state.error.value.split(NEWLINE_REGEXP), { |
| 1561 | onEmpty: () => "", |
| 1562 | onNonEmpty: (errorLines) => `${figures.pointerSmall} ${errorLines.join("\n")}` |
| 1563 | }) |
| 1564 | : "" |
| 1565 | const clearOutput = clearOutputWithError(promptText, columns, errorText) |
| 1566 | return clearOutput + resetCurrentLine |
| 1567 | }) |
| 1568 | } |
| 1569 | |
| 1570 | const renderDateError = (state: DateState, pointer: string): string => { |
| 1571 | if (Option.isSome(state.error)) { |
no test coverage detected