// What the social-links editor posts: its rows, trimmed, as the JSON both the // settings and the site actions parse with parseSocialLinks. Pure, so it has a // unit test (socialLinksJson.test.ts) without a DOM. export type SocialRow = { label: string; url: string; svg: string; // "Keep in header on small screens". Posted only when checked, the way the // schema stores it. featured?: boolean; }; export function socialLinksJson(rows: readonly SocialRow[]): string { return JSON.stringify( rows.map((s) => ({ label: s.label.trim(), url: s.url.trim(), svg: s.svg.trim(), ...(s.featured ? { featured: true } : {}), })), ); }