* Renders the given text as error text. * @param error Error text to render.
(error: Error|string)
| 18 | * @param error Error text to render. |
| 19 | */ |
| 20 | public static error(error: Error|string): string { |
| 21 | if (typeof error === 'string') { |
| 22 | return `\x1b[31;1m${error}\x1b[0m`; |
| 23 | } else { |
| 24 | return `\x1b[31;1m${error.message}\x1b[0m`; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Renders the given text with a highlight to call attention. |