Make _.startCase use _.capitalize.

This commit is contained in:
John-David Dalton
2015-09-14 18:03:32 -07:00
parent c313f0c135
commit 8278b1e79f

View File

@@ -10311,8 +10311,8 @@
if (!string) {
return string;
}
var symbols = stringToArray(string);
return symbols[0].toUpperCase() + symbols.slice(1).join('');
var array = stringToArray(string);
return array[0].toUpperCase() + array.slice(1).join('');
}
/**
@@ -10660,8 +10660,7 @@
* // => 'Foo Bar'
*/
var startCase = createCompounder(function(result, word, index) {
var symbols = stringToArray(word);
return result + (index ? ' ' : '') + (symbols[0].toUpperCase() + symbols.slice(1).join(''));
return result + (index ? ' ' : '') + capitalize(word);
});
/**