Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(isUppercase): assume characters lowercase by default #71

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 10, 2024

πŸ”— Linked issue

Resolves #69

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

isUppercase is used to return true for nonalphabetic characters such as -. This issue was not visible for the splitByCase util without custom splitters.

The fix checkes if string could be lowecased, it is an uppercase. (also adds tiny perf because the frequency of passed lowercase strings is much higher and it saves v8 engine to do anything for most of toLowercase() calls

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Jan 10, 2024

Codecov Report

All modified and coverable lines are covered by tests βœ…

Comparison is base (d2c281f) 100.00% compared to head (74ba20d) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #71   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines          340       340           
  Branches        39        39           
=========================================
  Hits           340       340           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0 pi0 merged commit 57cfd15 into main Jan 10, 2024
4 checks passed
@pi0 pi0 deleted the fix/upper-case branch January 10, 2024 12:16
pi0 added a commit that referenced this pull request Jan 10, 2024
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.

isUppercase considers non-alphabetic characters also as uppercase.
1 participant