Skip to content

Commit

Permalink
1.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
mym0404 committed Sep 11, 2023
1 parent 9e51c99 commit 8c5dd53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mj-studio/js-util",
"version": "1.0.12",
"version": "1.0.13",
"description": "Custom JavaScript Utilities for MJ Studio",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/internal/camelCase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ describe('convert strings to camelCase!', () => {
expect(camelCase('_____________________ ')).toBe('');
expect(camelCase('_________^^________mym0404 ')).toBe('^^Mym0404');
expect(camelCase('get_challenge_by_int:challenge_id')).toBe('getChallengeByIntChallengeId');
expect(camelCase('get_challenge_by_int-challenge_id')).toBe('getChallengeByIntChallengeId');
});
});
2 changes: 1 addition & 1 deletion src/internal/camelCase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
function convertCamelCaseFromSnakeCase(str: string): string {
return str
.trim() // 1. remove side white spaces
.replace(/:/g, '_')
.replace(/[:-]/g, '_')
.replace(/(^_+|_+$)/g, '') // 2. remove side underscores
.replace(/_+[a-z]/g, (word) => {
// 3. convert snake to camel
Expand Down

0 comments on commit 8c5dd53

Please sign in to comment.