summaryrefslogtreecommitdiff
path: root/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js')
-rw-r--r--bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js b/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js
new file mode 100644
index 00000000..fe8ea483
--- /dev/null
+++ b/bin/wiki/ImportarDesdeURL/node_modules/lodash/_createCaseFirst.js
@@ -0,0 +1,33 @@
+var castSlice = require('./_castSlice'),
+ hasUnicode = require('./_hasUnicode'),
+ stringToArray = require('./_stringToArray'),
+ toString = require('./toString');
+
+/**
+ * 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.
+ */
+function createCaseFirst(methodName) {
+ return function(string) {
+ string = toString(string);
+
+ var strSymbols = hasUnicode(string)
+ ? stringToArray(string)
+ : undefined;
+
+ var chr = strSymbols
+ ? strSymbols[0]
+ : string.charAt(0);
+
+ var trailing = strSymbols
+ ? castSlice(strSymbols, 1).join('')
+ : string.slice(1);
+
+ return chr[methodName]() + trailing;
+ };
+}
+
+module.exports = createCaseFirst;