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

Function analyzeHead

packages/devtools/src/tabs/seo-tab/social-previews.tsx:147–173  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

145 const reports: Array<SocialReport> = []
146
147 for (const social of SOCIALS) {
148 const found: Partial<SocialMeta> = {}
149 const missing: Array<string> = []
150 for (const tag of social.tags) {
151 const meta = metaTags.find(
152 (m) =>
153 (tag.key.includes('twitter:')
154 ? false
155 : m.getAttribute('property') === tag.key) ||
156 m.getAttribute('name') === tag.key,
157 )
158
159 if (meta && meta.getAttribute('content')) {
160 found[tag.prop as keyof SocialMeta] =
161 meta.getAttribute('content') || undefined
162 } else {
163 missing.push(tag.key)
164 }
165 }
166 reports.push({ network: social.network, found, missing })
167 }
168 return reports
169 }
170
171 createHeadChanges(() => {
172 setReports(analyzeHead())
173 })
174
175 return (
176 <Section>

Callers 1

SocialPreviewsSectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected