* Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function.
(methodName)
| 15570 | * @returns {Function} Returns the new case function. |
| 15571 | */ |
| 15572 | function createCaseFirst(methodName) { |
| 15573 | return function(string) { |
| 15574 | string = toString(string); |
| 15575 | |
| 15576 | var strSymbols = hasUnicode(string) |
| 15577 | ? stringToArray(string) |
| 15578 | : undefined; |
| 15579 | |
| 15580 | var chr = strSymbols |
| 15581 | ? strSymbols[0] |
| 15582 | : string.charAt(0); |
| 15583 | |
| 15584 | var trailing = strSymbols |
| 15585 | ? castSlice(strSymbols, 1).join('') |
| 15586 | : string.slice(1); |
| 15587 | |
| 15588 | return chr[methodName]() + trailing; |
| 15589 | }; |
| 15590 | } |
| 15591 | |
| 15592 | /** |
| 15593 | * Creates a function like `_.camelCase`. |
no test coverage detected