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

Capitalize only first letter of each word. Leave the rest of letters … #9

Merged
merged 2 commits into from
Nov 2, 2019
Merged

Capitalize only first letter of each word. Leave the rest of letters … #9

merged 2 commits into from
Nov 2, 2019

Conversation

sergejkaravajnij
Copy link
Contributor

Hello.
I’ve added a new method to capitalize only first letter of each word like CSS rule text-transform: capitalize do.
I found this was a reason of my automated tests failed sometimes.

@markjaquith
Copy link

Isn't this what capitalize.words() does?

@sergejkaravajnij
Copy link
Contributor Author

sergejkaravajnij commented Oct 13, 2019

Isn't this what capitalize.words() does?

There is a small difference exists which I cought in my automated tests.

Let assume we have such input string: canDoItRight

  • With CSS rule applied we've got: CanDoItRight

  • With capitalize.words() we'll have: Candoitright

That's the difference

If the preserve argument is truthy, letters that are not capitalized will not be modified.
@grncdr
Copy link
Owner

grncdr commented Nov 2, 2019

thanks @sergejkaravajnij ! I think this is a useful addition, but I’ve slightly refactored the proposed API.

@grncdr grncdr merged commit 666e76a into grncdr:master Nov 2, 2019
@sergejkaravajnij sergejkaravajnij deleted the develop branch November 30, 2019 10:35
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.

None yet

3 participants