MCPcopy Index your code
hub / github.com/deployd/deployd / createCaseFirst

Function createCaseFirst

test-app/public/sinon.js:15572–15590  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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`.

Callers 1

sinon.jsFile · 0.85

Calls 4

hasUnicodeFunction · 0.85
stringToArrayFunction · 0.85
castSliceFunction · 0.85
toStringFunction · 0.70

Tested by

no test coverage detected