MCPcopy Create free account
hub / github.com/Effect-TS/effect / renderDateError

Function renderDateError

packages/effect/src/unstable/cli/Prompt.ts:1570–1580  ·  view source on GitHub ↗
(state: DateState, pointer: string)

Source from the content-addressed store, hash-verified

1568}
1569
1570const 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
1582const renderParts = (state: DateState, submitted: boolean = false) => {
1583 return Arr.reduce(

Callers 1

Prompt.tsFile · 0.85

Calls 5

annotateErrorLineFunction · 0.85
joinMethod · 0.80
annotateMethod · 0.65
splitMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected