Skip to content

Commit

Permalink
Handling snake case as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Jør∂¡ committed Mar 14, 2024
1 parent e51fa71 commit 46b6dd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/case.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function decodeCamelCase(input?: string): string {
if (!input || typeof input !== "string") return "";

if (input.startsWith("_")) input = input.replace(/^_+/, "");
input = input.replace(/_+/g, " ").trim();
return (
input
.replace(/([a-z])([A-Z])/g, "$1 $2")
Expand Down

0 comments on commit 46b6dd3

Please sign in to comment.