MCPcopy Create free account
hub / github.com/TanStack/devtools / truncateToChars

Function truncateToChars

packages/devtools/src/tabs/seo-tab/serp-preview.tsx:84–88  ·  view source on GitHub ↗
(text: string, maxChars: number)

Source from the content-addressed store, hash-verified

82]
83
84function 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
90function getSerpFromHead(): SerpData {
91 const title = document.title || ''

Callers 1

SerpPreviewSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected