From 9a2739fb530ec38def136b98e79199376c2d5199 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Mon, 15 Apr 2024 09:16:59 -0400 Subject: [PATCH] Fix camelify to not alter first char The original change was to support snake_case, and the change for camelCase did not need to also change the case of the first character. --- packages/generate/src/genutil.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/generate/src/genutil.ts b/packages/generate/src/genutil.ts index 5c284789b..db910068e 100644 --- a/packages/generate/src/genutil.ts +++ b/packages/generate/src/genutil.ts @@ -482,9 +482,7 @@ export type Version = { }; export function camelify(str: string): string { - const base = str + return str .replace(/[-_][A-Za-z]/g, (m) => m[1].toUpperCase()) .replace(/^[^A-Za-z_]|\W/g, "_"); - - return base.charAt(0).toLowerCase() + base.slice(1); }