Skip to content

Commit

Permalink
fix: title
Browse files Browse the repository at this point in the history
  • Loading branch information
shiliuzi8686 committed Dec 10, 2024
1 parent a32ed49 commit 10db390
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ export const title = (str: string | null | undefined): string => {

return str
.split(/(?=[A-Z][a-z])|[\.\-\s_]/)
.map(s => s.trim())
.filter(s => !!s)
.map(s => {
if (s === s.toUpperCase()) {
// If the entire string segment is uppercase, capitalize it properly
Expand Down

0 comments on commit 10db390

Please sign in to comment.