diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index 368917b06..5cc44b29e 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -542,8 +542,12 @@ export function createAstro( const toAttributeString = (value: any, shouldEscape = true) => shouldEscape ? String(value).replace(/&/g, '&').replace(/"/g, '"') : value; -const kebab = (k: string) => k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`); -const toStyleString = (obj: Record) => Object.entries(obj).map(([k, v]) => `${kebab(k)}:${v}`).join(';') +const kebab = (k: string) => + k.toLowerCase() === k ? k : k.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`); +const toStyleString = (obj: Record) => + Object.entries(obj) + .map(([k, v]) => `${kebab(k)}:${v}`) + .join(';'); const STATIC_DIRECTIVES = new Set(['set:html', 'set:text']);