feat: implement toCamelCase utility function and update Clean Architecture generator to use it
This commit is contained in:
12
src/utils/name-formatter.ts
Normal file
12
src/utils/name-formatter.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Converts a PascalCase name to camelCase by lowercasing the first character.
|
||||
* Used to derive class filenames and variable names from schema/tag names.
|
||||
*
|
||||
* @example
|
||||
* toCamelCase('ProductResponse') // 'productResponse'
|
||||
* toCamelCase('UserSchema') // 'userSchema'
|
||||
*/
|
||||
export function toCamelCase(name: string): string {
|
||||
if (!name) return name;
|
||||
return name.charAt(0).toLowerCase() + name.slice(1);
|
||||
}
|
||||
Reference in New Issue
Block a user