Skip to content

[Bug] Case helpers (strCamelCase, strKebabCase, strSnakeCase, ...) - #636

Merged
nev21 merged 1 commit into
mainfrom
nev21/CaseIssues
Nov 8, 2026
Merged

nev21 merged 1 commit into
mainfrom
nev21/CaseIssues

Conversation

@nev21

@nev21 nev21 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

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

@nev21
nev21 requested review from a team as code owners November 7, 2026 23:10
Copilot AI balanced review requested due to automatic review settings November 7, 2026 23:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread lib/src/string/conversion.ts Resolved
Comment thread lib/src/string/conversion.ts Resolved
Copilot AI balanced review requested due to automatic review settings November 8, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread lib/src/string/conversion.ts Resolved
Comment thread lib/src/string/conversion.ts Resolved
Copilot AI balanced review requested due to automatic review settings November 8, 2026 02:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread lib/src/internal/unwrapFunction.ts Resolved
@nev21 nev21 assigned Copilot and unassigned Copilot Nov 8, 2026
@nev21
nev21 requested a balanced review from Copilot November 8, 2026 03:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

…talizeWords): case not normalised, inconsistent word boundaries, non-ASCII letters dropped #634
Copilot AI balanced review requested due to automatic review settings November 8, 2026 16:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.21%. Comparing base (49bffdb) to head (4bca651).

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           
Files with missing lines Coverage Δ
lib/src/funcs/funcs.ts 100.00% <100.00%> (ø)
lib/src/internal/constants.ts 100.00% <100.00%> (ø)
lib/src/internal/unwrapFunction.ts 100.00% <100.00%> (ø)
lib/src/string/conversion.ts 100.00% <100.00%> (ø)
lib/src/string/substring.ts 100.00% <100.00%> (ø)
lib/src/string/upper_lower.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nev21 nev21 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nev21
nev21 enabled auto-merge (squash) November 8, 2026 16:38

@nevware21-bot nevware21-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by nevware21-bot

@nev21
nev21 merged commit 5131c96 into main Nov 8, 2026
10 checks passed
@nev21
nev21 deleted the nev21/CaseIssues branch November 8, 2026 17:38
@nev21 nev21 added this to the 0.17.0 milestone Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants