From b73ec1417117ccc479183fec6efcf06990e5b905 Mon Sep 17 00:00:00 2001 From: Rishi Raj Jain Date: Tue, 27 Sep 2022 00:54:51 +0530 Subject: [PATCH] Change negative lookbehind to lookahead (#4866) --- packages/astro/src/runtime/server/render/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/astro/src/runtime/server/render/util.ts b/packages/astro/src/runtime/server/render/util.ts index f98d444562..31a6bf21a7 100644 --- a/packages/astro/src/runtime/server/render/util.ts +++ b/packages/astro/src/runtime/server/render/util.ts @@ -15,7 +15,7 @@ const STATIC_DIRECTIVES = new Set(['set:html', 'set:text']); // converts (most) arbitrary strings to valid JS identifiers const toIdent = (k: string) => - k.trim().replace(/(?:(? { + k.trim().replace(/(?:(?!^)\b\w|\s+|[^\w]+)/g, (match, index) => { if (/[^\w]|\s/.test(match)) return ''; return index === 0 ? match : match.toUpperCase(); });