* 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)
| 12592 | * @returns {Function} Returns the new case function. |
| 12593 | */ |
| 12594 | function createCaseFirst(methodName) { |
| 12595 | return function(string) { |
| 12596 | string = toString(string); |
| 12597 | |
| 12598 | var strSymbols = hasUnicode(string) |
| 12599 | ? stringToArray(string) |
| 12600 | : undefined; |
| 12601 | |
| 12602 | var chr = strSymbols |
| 12603 | ? strSymbols[0] |
| 12604 | : string.charAt(0); |
| 12605 | |
| 12606 | var trailing = strSymbols |
| 12607 | ? castSlice(strSymbols, 1).join('') |
| 12608 | : string.slice(1); |
| 12609 | |
| 12610 | return chr[methodName]() + trailing; |
| 12611 | }; |
| 12612 | } |
| 12613 | |
| 12614 | /** |
| 12615 | * Creates a function like `_.camelCase`. |
no test coverage detected