Repository navigation
[Bug] Case helpers (strCamelCase, strKebabCase, strSnakeCase, ...) - #636
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved Unicode-handling bugs drop valid characters, create false word boundaries, and incorrectly normalize Greek final sigma during capitalization.
2 open issues
What changed in this PR
This PR addresses #634 by improving word detection and non-ASCII handling in the library’s case helpers while retaining existing camel-case normalization and edge-separator behavior.
Changes:
- Introduces fixed-range word matching for non-ASCII text, acronym boundaries, and digit-to-uppercase transitions.
- Reduces allocations in native-function wrappers and uses shared method-name constants.
- Expands regression tests, documents output changes, and adjusts bundle-size limits.
| File | Description |
|---|---|
lib/test/src/common/string/conversion.test.ts |
Adds boundary, non-ASCII, compatibility, and round-trip tests. |
lib/test/src/common/internal/unwrapFunction.test.ts |
Tests argument counts in wrapper error messages. |
lib/test/bundle-size-check.js |
Raises bundle-size thresholds. |
lib/src/string/upper_lower.ts |
Uses shared case-conversion method constants. |
lib/src/string/substring.ts |
Uses the shared substring method constant. |
lib/src/string/conversion.ts |
Reworks word matching and case conversion; documents behavior. |
lib/src/internal/unwrapFunction.ts |
Forwards arguments without slicing and expands error details. |
lib/src/internal/constants.ts |
Adds shared string-method names. |
CHANGELOG.md |
Documents behavior changes and performance improvements. |
.size-limit.json |
Updates distribution-size budgets. |
Review effort: Balanced
1abf940 to
861173b
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved Unicode handling defects cause incorrect casing of supplementary-plane letters and inconsistent word boundaries for accented Greek capitals across normalization forms.
2 open issues
2 resolved since last review
Review effort: Balanced
861173b to
d0893f3
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new dispatch relies on the target method’s own call property, causing exceptions or incorrect invocation when it is overridden, and both affected wrappers need to use the intrinsic Function.prototype.call.
1 open issue
2 resolved since last review
Review effort: Balanced
…talizeWords): case not normalised, inconsistent word boundaries, non-ASCII letters dropped #634
d0893f3 to
4bca651
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #636 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 180 180
Lines 5590 5630 +40
Branches 1262 1297 +35
=======================================
+ Hits 5546 5586 +40
Misses 44 44
🚀 New features to boost your workflow:
|
nevware21-bot
left a comment
There was a problem hiding this comment.
Approved by nevware21-bot

[Bug] Case helpers (strCamelCase, strKebabCase, strSnakeCase, strCapitalizeWords): case not normalised, inconsistent word boundaries, non-ASCII letters dropped
#634