chore: update helpers

This commit is contained in:
vben
2024-06-02 10:29:17 +08:00
parent 8f1b054bb1
commit fc423c3657
19 changed files with 361 additions and 353 deletions

View File

@@ -17,4 +17,16 @@ function toLowerCaseFirstLetter(str: string): string {
return str.charAt(0).toLowerCase() + str.slice(1);
}
export { capitalizeFirstLetter, toLowerCaseFirstLetter };
/**
* 生成驼峰命名法的键名
* @param key
* @param parentKey
*/
function toCamelCase(key: string, parentKey: string): string {
if (!parentKey) {
return key;
}
return parentKey + key.charAt(0).toUpperCase() + key.slice(1);
}
export { capitalizeFirstLetter, toCamelCase, toLowerCaseFirstLetter };