Skip to content

Commit

Permalink
fix: status case
Browse files Browse the repository at this point in the history
  • Loading branch information
tabaktoni committed Aug 29, 2023
1 parent 0c15422 commit 5ba7983
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/utils/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ export function utf8ToArray(str: string): Uint8Array {
* @returns string
*/
export const pascalToSnake = (text: string) =>
text
.split(/(?=[A-Z])/)
.join('_')
.toUpperCase();
/[a-z]/.test(text)
? text
.split(/(?=[A-Z])/)
.join('_')
.toUpperCase()
: text;

0 comments on commit 5ba7983

Please sign in to comment.