Skip to content

Commit c161215

Browse files
committed
remove camelize entirely, revert version bump
Delete the deprecated camelize() function instead of keeping it as a wrapper. Remove all camelize references from tests and README docs. Dan will handle version bumping.
1 parent 0b81bd3 commit c161215

3 files changed

Lines changed: 0 additions & 36 deletions

File tree

packages/inflekt/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ inflektTree(apiResponse, toCamelCase);
101101
- `toScreamingSnake(str)` - Convert to SCREAMING_SNAKE_CASE
102102
- `underscore(str)` - Convert PascalCase/camelCase to snake_case
103103
- `fixCapitalisedPlural(str)` - Fix capitalized S after numbers (e.g., `Table1S` -> `Table1s`)
104-
- `camelize(str, lowFirstLetter?)` - **Deprecated.** Use `toCamelCase` or `toPascalCase` instead
105104

106105
### Naming Helpers
107106

packages/inflekt/__tests__/inflection.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
distinctPluralizeLast,
88
lcFirst,
99
ucFirst,
10-
camelize,
1110
toCamelCase,
1211
toPascalCase,
1312
toScreamingSnake,
@@ -256,25 +255,6 @@ describe('toScreamingSnake', () => {
256255
});
257256
});
258257

259-
describe('camelize (deprecated)', () => {
260-
it('should delegate to toPascalCase by default', () => {
261-
expect(camelize('user_profile')).toBe('UserProfile');
262-
expect(camelize('order_item')).toBe('OrderItem');
263-
expect(camelize('api_schema')).toBe('ApiSchema');
264-
});
265-
266-
it('should delegate to toCamelCase when lowFirstLetter is true', () => {
267-
expect(camelize('user_profile', true)).toBe('userProfile');
268-
expect(camelize('order_item', true)).toBe('orderItem');
269-
expect(camelize('api_schema', true)).toBe('apiSchema');
270-
});
271-
272-
it('should handle single words', () => {
273-
expect(camelize('user')).toBe('User');
274-
expect(camelize('user', true)).toBe('user');
275-
});
276-
});
277-
278258
describe('underscore', () => {
279259
it('should convert PascalCase to snake_case', () => {
280260
expect(underscore('UserProfile')).toBe('user_profile');

packages/inflekt/src/case.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,6 @@ export function fixCapitalisedPlural(str: string): string {
2727
return str.replace(/[0-9]S(?=[A-Z]|$)/g, (match) => match.toLowerCase());
2828
}
2929

30-
/**
31-
* Convert snake_case to PascalCase (or camelCase if lowFirstLetter is true)
32-
* @deprecated Use `toCamelCase` or `toPascalCase` instead for a cleaner, declarative API.
33-
* @param str - The snake_case string to convert
34-
* @param lowFirstLetter - If true, returns camelCase instead of PascalCase
35-
* @example camelize('user_profile') -> 'UserProfile'
36-
* @example camelize('user_profile', true) -> 'userProfile'
37-
*/
38-
export function camelize(str: string, lowFirstLetter?: boolean): string {
39-
if (lowFirstLetter) {
40-
return toCamelCase(str);
41-
}
42-
return toPascalCase(str);
43-
}
44-
4530
/**
4631
* Convert PascalCase or camelCase to snake_case
4732
* @example underscore('UserProfile') -> 'user_profile'

0 commit comments

Comments
 (0)