Version 1
[yaffs-website] / node_modules / underscore.string / capitalize.js
diff --git a/node_modules/underscore.string/capitalize.js b/node_modules/underscore.string/capitalize.js
new file mode 100644 (file)
index 0000000..2693376
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function capitalize(str, lowercaseRest) {
+  str = makeString(str);
+  var remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase();
+
+  return str.charAt(0).toUpperCase() + remainingChars;
+};