(text?: string)
| 1 | import { decodeHTML as decode } from 'entities'; |
| 2 | |
| 3 | export function decodeHTML(text?: string): string { |
| 4 | if (!text) { |
| 5 | return ''; |
| 6 | } |
| 7 | try { |
| 8 | return decode(text); |
| 9 | } catch (exception) { |
| 10 | return ''; |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | export function truncate(text: string, limit: number): string { |
| 15 | if (text.length > limit) { |
no test coverage detected