Ensure _.startCase only uppercases the first character of each word.

This commit is contained in:
John-David Dalton
2016-03-17 21:07:55 -07:00
parent 8d7058e6ad
commit 9735961090
2 changed files with 23 additions and 7 deletions

View File

@@ -13208,17 +13208,17 @@
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar');
* _.startCase('--foo-bar--');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__foo_bar__');
* // => 'Foo Bar'
* _.startCase('__FOO_BAR__');
* // => 'FOO BAR'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + capitalize(word);
return result + (index ? ' ' : '') + upperFirst(word);
});
/**