Skip to content

docs: fix trainCase example output in README#133

Open
patrickwehbe wants to merge 1 commit into
unjs:mainfrom
patrickwehbe:docs-traincase-example-output
Open

docs: fix trainCase example output in README#133
patrickwehbe wants to merge 1 commit into
unjs:mainfrom
patrickwehbe:docs-traincase-example-output

Conversation

@patrickwehbe

@patrickwehbe patrickwehbe commented Jul 2, 2026

Copy link
Copy Markdown

The README example for trainCase shows the wrong output:

trainCase("FooBARb");
// Foo-Ba-Rb

The actual return value is Foo-BA-Rb. Without normalize, an uppercase run is preserved, which is exactly what the note right under the example states ("if an uppercase letter is followed by other uppercase letters they are preserved"), and what the existing splitByCase("FooBARb") test (["Foo", "BA", "Rb"]) implies. Foo-Ba-Rb is the { normalize: true } result, so the example was showing the normalized output for a non-normalized call.

Verified by running the current source:

trainCase("FooBARb") => Foo-BA-Rb

Docs-only change, no code touched.

Summary by CodeRabbit

  • Documentation
    • Corrected the expected output in a code example to match the actual casing behavior.

trainCase("FooBARb") returns Foo-BA-Rb, not Foo-Ba-Rb. Without normalize the uppercase run is kept, as the note right below the example says (and as the splitByCase test for FooBARb shows). The old output was the normalize: true result.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 453eb2a7-31a7-4ef2-8bc7-751f79b857b8

📥 Commits

Reviewing files that changed from the base of the PR and between 5bc6804 and 69ff29a.

📒 Files selected for processing (1)
  • README.md

📝 Walkthrough

Walkthrough

This change corrects a documentation typo in README.md, updating the expected output comment for the trainCase("FooBARb") example from Foo-Ba-Rb to Foo-BA-Rb to accurately reflect the function's casing behavior.

Changes

Documentation Correction

Layer / File(s) Summary
Fix trainCase example comment
README.md
Corrects the expected output comment in the trainCase("FooBARb") example from Foo-Ba-Rb to Foo-BA-Rb.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the docs-only README fix for the trainCase example output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant