mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Make _.startCase use _.capitalize.
This commit is contained in:
@@ -10311,8 +10311,8 @@
|
|||||||
if (!string) {
|
if (!string) {
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
var symbols = stringToArray(string);
|
var array = stringToArray(string);
|
||||||
return symbols[0].toUpperCase() + symbols.slice(1).join('');
|
return array[0].toUpperCase() + array.slice(1).join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10660,8 +10660,7 @@
|
|||||||
* // => 'Foo Bar'
|
* // => 'Foo Bar'
|
||||||
*/
|
*/
|
||||||
var startCase = createCompounder(function(result, word, index) {
|
var startCase = createCompounder(function(result, word, index) {
|
||||||
var symbols = stringToArray(word);
|
return result + (index ? ' ' : '') + capitalize(word);
|
||||||
return result + (index ? ' ' : '') + (symbols[0].toUpperCase() + symbols.slice(1).join(''));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user