Fix empty snake case conversions - #6859
Conversation
🦋 Changeset detectedLatest commit: 42036ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Added reproduction tests — two
it("handles an empty string")tests forsnakeToCamelandsnakeToPascalthat assert empty-string input should return"".
Confirmed both tests fail against current code:
snakeToCamel("")returnsundefined(self[0]on empty string)snakeToPascal("")throwsTypeError: Cannot read properties of undefined (reading 'toUpperCase')
Tests follow existing surrounding patterns and are exactly the assertions needed.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Added empty-string guards —
snakeToCamelandsnakeToPascalnow return""for empty input viaif (self.length === 0) return selfguards, fixing theundefinedreturn andTypeErrorthe reproduction tests surfaced.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
String.snakeToCamel("")andString.snakeToPascal("")return the empty stringVerification
pnpm test --run packages/effect/test/String.test.tspnpm lintpnpm checkCloses EFF-300