mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Ensure _.startCase only uppercases the first character of each word.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user