-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug where generated table functions don't match up with actual …
…table functions at runtime if the table has a `.` in its name.
- Loading branch information
1 parent
d3b616a
commit f94ddb4
Showing
3 changed files
with
25 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Transforms a string into the pascal-case format. | ||
* ThisIsPascalCase, while thisIsCamelCase, this-is-kebab-case, and this_is_snake_case. | ||
* @author Kevin Brown <github.com/thekevinbrown> | ||
* @param value String for case transformation | ||
*/ | ||
export const pascalCase = (value: string) => { | ||
const snakePattern = /[_.]+./g; | ||
const upperFirst = value[0].toUpperCase() + value.slice(1); | ||
return upperFirst.replace(snakePattern, match => match[match.length - 1].toUpperCase()); | ||
}; | ||
|
||
/** | ||
* Transforms a string into the camel-case format. | ||
* ThisIsPascalCase, while thisIsCamelCase, this-is-kebab-case, and this_is_snake_case. | ||
* @author Kevin Brown <github.com/thekevinbrown> | ||
* @param value String for case transformation | ||
*/ | ||
export const camelCase = (value: string) => { | ||
const snakePattern = /[_.]+./g; | ||
return value.replace(snakePattern, match => match[match.length - 1].toUpperCase()); | ||
}; |