refactor(inflekt): remove camelize, standardize on toCamelCase/toPascalCase#72
Merged
pyramation merged 2 commits intomainfrom Mar 26, 2026
Merged
Conversation
- toCamelCase and toPascalCase are now the primary API (handle both _ and - delimiters) - camelize is deprecated and delegates to toCamelCase/toPascalCase internally - Updated all tests and docs to use the new declarative API - No boolean second parameter - use toCamelCase() or toPascalCase() directly
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4 tasks
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.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Breaking change: Completely removes the
camelize(str, lowFirstLetter?)function from inflekt. The case-conversion API now exposes two declarative functions with no boolean parameters:toCamelCase(str)— always returns camelCasetoPascalCase(str)— always returns PascalCaseBoth handle
_,-, and existing camelCase/PascalCase boundaries. The oldcamelizeimplementation only split on_; the new functions use a regex (/[-_](.)/g) that also handles-.Tests (88 passing), README, and JSDoc comments are all updated. No version bump — Dan will handle versioning when publishing.
Updates since last revision
camelizeentirely instead of deprecating it (per reviewer feedback: "DELETE THE OLD SHIT")camelizefrom test imports, deleted its test suite (3 test cases removed)camelizeline from README API sectionReview & Testing Checklist for Human
camelizefrominflektwill fail at compile time. Verify the companion PR (constructive#897) migrates all call sites before publishing.camelizeis fully removed fromsrc/index.tsre-exports: Confirm it's not still listed in the barrel export, which would cause a build error.camelizeused.split('_').map(...)whiletoPascalCase/toCamelCaseuse/[-_](.)/g. Inputs with double underscores (foo__bar), trailing delimiters (foo_), or other edge cases will behave differently. The audit found only clean snake_case inputs in practice — verify this holds for your codebase.Suggested test plan: Run
pnpm testinpackages/inflekt, then grep across constructive for any remainingcamelizeimports before publishing.Notes
camelize()call sites totoCamelCase/toPascalCase. That PR must land before or alongside this one.toScreamingSnakewas added in a prior PR but is now properly documented and tested here.Link to Devin session: https://app.devin.ai/sessions/e3dd5ed7753043bd8d2166793364cd42
Requested by: @pyramation