Skip to content

Conversation

@pi0
Copy link
Member

@pi0 pi0 commented Feb 6, 2024

πŸ”— Linked issue

❓ 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

This adds a new titleCase utility.

I have reused the trainCase type utils extended to support joiner but the types are not accurate (and traincase types are also seem not working properly)

For runtime impl I have essentially duplicated logic because this allows to independently improve them both without adding more complexity.

I also used a compact regex that handles very common exceptions that need to be lowercased. A compromise that is not perfect but better than random inline - to replaces we use everywhere to have title-case-like output.

ideas welcome to improve πŸ‘πŸΌ

πŸ“ Checklist

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

@pi0 pi0 changed the title feat: title case util feat: trainCase util Feb 6, 2024
@pi0 pi0 merged commit 146ecd0 into main Feb 6, 2024
@pi0 pi0 deleted the feat/title-case branch February 6, 2024 16:55
@pi0 pi0 changed the title feat: trainCase util feat: titleCase util Feb 8, 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.

2 participants