From 5b34a538d5d19a7b1eda703f5abb190209fcc548 Mon Sep 17 00:00:00 2001 From: Stef Lewandowski Date: Tue, 15 Oct 2024 08:53:32 +0100 Subject: [PATCH] fix: remove lookbehind in regex --- packages/core/src/utils/camelCaseToSentenceCase.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/utils/camelCaseToSentenceCase.ts b/packages/core/src/utils/camelCaseToSentenceCase.ts index 79b81c414..257769957 100644 --- a/packages/core/src/utils/camelCaseToSentenceCase.ts +++ b/packages/core/src/utils/camelCaseToSentenceCase.ts @@ -2,5 +2,5 @@ export function camelCaseToSentenceCase(str: string) { return str .replace(/([A-Z0-9])/g, " $1") // Insert a space before each uppercase letter or digit .replace(/^./, (str) => str.toUpperCase()) - .replace(/(?<=\s)[A-Z]/g, (str) => str.toLowerCase()); + .replace(/\s[A-Z]/g, (str) => str.toLowerCase()); }