Permalink
Browse files

Update lib/cli-table/utils.js

Because of error

```/root/tok/node_modules/alfred/node_modules/step/lib/step.js:39
        throw arguments[0];
                       ^
TypeError: Cannot use 'in' operator to search for 'chars' in undefined
    at Object.exports.options (/root/tok/node_modules/cli-table/lib/cli-table/utils.js:78:36)
```
  • Loading branch information...
1 parent 1128116 commit 171947a35126938b88af3c1ffe9619efb82a93ec @crackcomm crackcomm committed Sep 19, 2012
Showing with 11 additions and 10 deletions.
  1. +11 −10 lib/cli-table/utils.js
View
@@ -1,4 +1,3 @@
-
/**
* Repeats a string.
*
@@ -72,17 +71,19 @@ function clone(a){
return a;
};
-exports.options = function (defaults, opts){
- if (!opts) opts = {};
-
- var c = clone(opts);
- for (var i in defaults)
- if (!(i in opts))
- c[i] = defaults[i];
- return c;
+exports.options = function(defaults, opts) {
+ var c, i, _i, _len, _results;
+ c = clone(opts);
+ _results = [];
+ for (_i = 0, _len = defaults.length; _i < _len; _i++) {
+ i = defaults[_i];
+ if (i && [].__indexOf.call(opts, i) >= 0) {
+ _results.push(c[_i] = i);
+ }
+ }
+ return _results;
};
-
//
// For consideration of terminal "color" programs like colors.js,
// which can add ANSI escape color codes to strings,

0 comments on commit 171947a

Please sign in to comment.