From 07f4528f449281afb7bbc154b09292244795a183 Mon Sep 17 00:00:00 2001 From: bholmesdev Date: Wed, 20 Jul 2022 21:03:44 -0400 Subject: [PATCH] wip: add jsx-runtime fix --- packages/astro/src/runtime/server/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/astro/src/runtime/server/index.ts b/packages/astro/src/runtime/server/index.ts index d3a31bf6b..039ddc47f 100644 --- a/packages/astro/src/runtime/server/index.ts +++ b/packages/astro/src/runtime/server/index.ts @@ -542,6 +542,8 @@ 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 STATIC_DIRECTIVES = new Set(['set:html', 'set:text']); // A helper used to turn expressions into attribute key/value