Skip to content

Commit

Permalink
Update humanize documentation (#27)
Browse files Browse the repository at this point in the history
* update documentation to better detail expected functionality

* update tests to demonstrate internal capitalization
  • Loading branch information
tsmith1024 authored and markbates committed Nov 21, 2019
1 parent 0a3cf22 commit 92a7634
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion humanize.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import (
"strings"
)

// Humanize returns first letter of sentence capitalized
// Humanize returns first letter of sentence capitalized.
// Common acronyms are capitalized as well.
// Other capital letters in string are left as provided.
// employee_salary = Employee salary
// employee_id = employee ID
// employee_mobile_number = Employee mobile number
// first_Name = First Name
// firstName = First Name
func Humanize(s string) string {
return New(s).Humanize().String()
}
Expand Down
2 changes: 2 additions & 0 deletions humanize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ func Test_Humanize(t *testing.T) {
{"employee_id", "Employee ID"},
{"employee_ID", "Employee ID"},
{"first_name", "First name"},
{"first_Name", "First Name"},
{"firstName", "First Name"},
}

for _, tt := range table {
Expand Down

0 comments on commit 92a7634

Please sign in to comment.