MCPcopy
hub / github.com/Kong/insomnia / createCaseFirst

Function createCaseFirst

packages/insomnia/bin/yarn-standalone.js:12594–12612  ·  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

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

Callers 1

yarn-standalone.jsFile · 0.85

Calls 4

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

Tested by

no test coverage detected