(t0)
| 45 | return content.replace(URL_IN_JSON, url => createHyperlink(url)); |
| 46 | } |
| 47 | export function OutputLine(t0) { |
| 48 | const $ = _c(11); |
| 49 | const { |
| 50 | content, |
| 51 | verbose, |
| 52 | isError, |
| 53 | isWarning, |
| 54 | linkifyUrls |
| 55 | } = t0; |
| 56 | const { |
| 57 | columns |
| 58 | } = useTerminalSize(); |
| 59 | const expandShellOutput = useExpandShellOutput(); |
| 60 | const inVirtualList = React.useContext(InVirtualListContext); |
| 61 | const shouldShowFull = verbose || expandShellOutput; |
| 62 | let t1; |
| 63 | if ($[0] !== columns || $[1] !== content || $[2] !== inVirtualList || $[3] !== linkifyUrls || $[4] !== shouldShowFull) { |
| 64 | bb0: { |
| 65 | let formatted = tryJsonFormatContent(content); |
| 66 | if (linkifyUrls) { |
| 67 | formatted = linkifyUrlsInText(formatted); |
| 68 | } |
| 69 | if (shouldShowFull) { |
| 70 | t1 = stripUnderlineAnsi(formatted); |
| 71 | break bb0; |
| 72 | } |
| 73 | t1 = stripUnderlineAnsi(renderTruncatedContent(formatted, columns, inVirtualList)); |
| 74 | } |
| 75 | $[0] = columns; |
| 76 | $[1] = content; |
| 77 | $[2] = inVirtualList; |
| 78 | $[3] = linkifyUrls; |
| 79 | $[4] = shouldShowFull; |
| 80 | $[5] = t1; |
| 81 | } else { |
| 82 | t1 = $[5]; |
| 83 | } |
| 84 | const formattedContent = t1; |
| 85 | const color = isError ? "error" : isWarning ? "warning" : undefined; |
| 86 | let t2; |
| 87 | if ($[6] !== formattedContent) { |
| 88 | t2 = <Ansi>{formattedContent}</Ansi>; |
| 89 | $[6] = formattedContent; |
| 90 | $[7] = t2; |
| 91 | } else { |
| 92 | t2 = $[7]; |
| 93 | } |
| 94 | let t3; |
| 95 | if ($[8] !== color || $[9] !== t2) { |
| 96 | t3 = <MessageResponse><Text color={color}>{t2}</Text></MessageResponse>; |
| 97 | $[8] = color; |
| 98 | $[9] = t2; |
| 99 | $[10] = t3; |
| 100 | } else { |
| 101 | t3 = $[10]; |
| 102 | } |
| 103 | return t3; |
| 104 | } |
nothing calls this directly
no test coverage detected