(str, num, ellipsis = true)
| 213 | } |
| 214 | |
| 215 | export function truncateString(str, num, ellipsis = true) { |
| 216 | if (str.length > num) { |
| 217 | return `${str.slice(0, num)}${ellipsis ? '...' : ''}`; |
| 218 | } else { |
| 219 | return str; |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | export function htmlMetaDescription(str, isHtml = true) { |
| 224 | const text = isHtml ? htmlToPlainText(str) : str; |
no outgoing calls
no test coverage detected