Permalink
Browse files

[minor] Cleanup for JSHint

  • Loading branch information...
1 parent 6cc0578 commit 5d8bf755d1cb99c9a8e9c5e54cd91a81eae50d25 @indexzero indexzero committed Oct 4, 2011
Showing with 11 additions and 12 deletions.
  1. +11 −12 lib/cliff.js
View
@@ -25,7 +25,7 @@ cliff.inspect = eyes.inspector({ stream: null,
special: 'grey', // null, undefined...
number: 'blue', // 0, 1, 2...
bool: 'magenta', // true false
- regexp: 'green', // /\d+/
+ regexp: 'green' // /\d+/
}
});
@@ -72,9 +72,7 @@ cliff.columnMajor = function (rows) {
cliff.arrayLengths = function (arrs) {
var i, lengths = [];
for (i = 0; i < arrs.length; i += 1) {
- lengths.push(longestElement(arrs[i].map(function(elem) {
- return cliff.stringifyLiteral(elem);
- })));
+ lengths.push(longestElement(arrs[i].map(cliff.stringifyLiteral)));
}
return lengths;
};
@@ -240,19 +238,20 @@ cliff.typeOf = function typeOf (value) {
}
return s;
-}
+};
var realLength = function (str) {
return ("" + str).replace(/\u001b\[\d+m/g,'').length;
-}
+};
var longestElement = function (a) {
var l = 0;
- for (var i = 0; i < a.length; i++) {
- var new_l = realLength(a[i]);
- if (l < new_l) {
- l = new_l;
- }
+ for (var i = 0; i < a.length; i++) {
+ var new_l = realLength(a[i]);
+ if (l < new_l) {
+ l = new_l;
}
+ }
+
return l;
-}
+};

0 comments on commit 5d8bf75

Please sign in to comment.