(text: string, maxChars: number)
| 82 | ] |
| 83 | |
| 84 | function truncateToChars(text: string, maxChars: number): string { |
| 85 | if (text.length <= maxChars) return text |
| 86 | if (maxChars <= ELLIPSIS.length) return ELLIPSIS |
| 87 | return text.slice(0, maxChars - ELLIPSIS.length) + ELLIPSIS |
| 88 | } |
| 89 | |
| 90 | function getSerpFromHead(): SerpData { |
| 91 | const title = document.title || '' |
no outgoing calls
no test coverage detected