Permalink
Browse files

Fix capitalisation of zero length strings

  • Loading branch information...
1 parent 120adaa commit b5d4441ea949ec7918ae8514a700e69c05d44acf @GothAck committed May 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/filters.js
View
@@ -27,7 +27,7 @@ exports.last = function(obj) {
exports.capitalize = function(str){
str = String(str);
- return str[0].toUpperCase() + str.substr(1, str.length);
+ return str.charAt(0).toUpperCase() + str.substr(1, str.length);
};
/**
@@ -195,4 +195,4 @@ exports.get = function(obj, prop){
*/
exports.json = function(obj){
return JSON.stringify(obj);
-};
+};

0 comments on commit b5d4441

Please sign in to comment.