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

Add flag to capitalize to lowercase remaining characters #408

Merged
merged 1 commit into from
Feb 17, 2015

Conversation

ricardograca
Copy link
Contributor

This adds a new flag to capitalize that when set to true will convert all characters after the first one to lowercase. Example:

capitalize("FOO Bar", true);
// => "Foo bar"

@@ -129,6 +129,7 @@ $(document).ready(function() {
equal(_('fabio').capitalize(), 'Fabio', 'First letter is upper case');
equal(_.capitalize('fabio'), 'Fabio', 'First letter is upper case');
equal(_.capitalize('FOO'), 'FOO', 'Other letters unchanged');
equal(_.capitalize('FOO', true), 'Foo', 'Other letters are lowercased');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add some more test i.e

equal(_.capitalize('foO', true), 'Foo', 'Other letters are lowercased');

// and maybe some tests with lowercaseRest explicit "false"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks.

@stoeffel
Copy link
Collaborator

Could you squash your commits to one? Would be nice, thanks.
squashing commits

@ricardograca
Copy link
Contributor Author

All of them? Because the Contributing document mentions providing separate commits with tests.

@stoeffel
Copy link
Collaborator

Yes, I would make one commit it's not really a bug. One commit would be cool.
Thanks and sorry for the nitpicking 😄

stoeffel added a commit that referenced this pull request Feb 17, 2015
 Add flag to capitalize to lowercase remaining characters
@stoeffel stoeffel merged commit 19b59ba into esamattis:master Feb 17, 2015
@stoeffel
Copy link
Collaborator

👍

@ricardograca
Copy link
Contributor Author

😂

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