diff options
author | Rebecca Turner <me@re-becca.org> | 2015-08-14 10:24:25 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-08-14 22:25:45 +0300 |
commit | e429a481dc050420b045f88b89d4db54cb7095be (patch) | |
tree | a2aff25fd6f3b3b61b0d7ad13982355fca93fe9a /node_modules/columnify | |
parent | 797d3ca59e74b26a2466c80ed2d519a070f7a194 (diff) |
columnify@1.5.2
Diffstat (limited to 'node_modules/columnify')
-rw-r--r-- | node_modules/columnify/columnify.js | 26 | ||||
-rw-r--r-- | node_modules/columnify/package.json | 31 |
2 files changed, 25 insertions, 32 deletions
diff --git a/node_modules/columnify/columnify.js b/node_modules/columnify/columnify.js index db10a0118..42b2089a3 100644 --- a/node_modules/columnify/columnify.js +++ b/node_modules/columnify/columnify.js @@ -1,6 +1,4 @@ -'use strict'; - -var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; +"use strict"; var wcwidth = require('./width'); @@ -35,7 +33,7 @@ var DEFAULTS = Object.freeze({ }); module.exports = function (items) { - var options = arguments[1] === undefined ? {} : arguments[1]; + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var columnConfigs = options.config || {}; delete options.config; // remove config so doesn't appear on every column. @@ -217,6 +215,7 @@ function createRows(items, columns, columnNames, paddingChr) { columnNames.forEach(function (columnName) { numLines = Math.max(numLines, item[columnName].length); }); + // combine matching lines of each rows var _loop = function (i) { row[i] = row[i] || []; @@ -227,7 +226,6 @@ function createRows(items, columns, columnNames, paddingChr) { }); }; - // combine matching lines of each rows for (var i = 0; i < numLines; i++) { _loop(i); } @@ -242,18 +240,13 @@ function createRows(items, columns, columnNames, paddingChr) { */ function mixin() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - if (Object.assign) { - return Object.assign.apply(Object, _toConsumableArray(args)); - }return ObjectAssign.apply(undefined, _toConsumableArray(args)); + if (Object.assign) return Object.assign.apply(Object, arguments); + return ObjectAssign.apply(undefined, arguments); } function ObjectAssign(target, firstSource) { - 'use strict'; - if (target === undefined || target === null) throw new TypeError('Cannot convert first argument to object'); + "use strict"; + if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object"); var to = Object(target); @@ -295,9 +288,8 @@ function endsWith(target, searchString, position) { } function toArray(items, columnNames) { - if (Array.isArray(items)) { - return items; - }var rows = []; + if (Array.isArray(items)) return items; + var rows = []; for (var key in items) { var item = {}; item[columnNames[0] || 'key'] = key; diff --git a/node_modules/columnify/package.json b/node_modules/columnify/package.json index a790a09c2..1c9b23ddf 100644 --- a/node_modules/columnify/package.json +++ b/node_modules/columnify/package.json @@ -6,15 +6,15 @@ ] ], "_from": "columnify@>=1.5.1 <1.6.0", - "_id": "columnify@1.5.1", + "_id": "columnify@1.5.2", "_inCache": true, "_location": "/columnify", - "_nodeVersion": "0.10.36", + "_nodeVersion": "2.0.1", "_npmUser": { "email": "secoif@gmail.com", "name": "timoxley" }, - "_npmVersion": "2.7.6", + "_npmVersion": "2.9.0", "_phantomChildren": {}, "_requested": { "name": "columnify", @@ -27,8 +27,8 @@ "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz", - "_shasum": "15fdda803a3875f87f9d302b3bc828932d664003", + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz", + "_shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", "_shrinkwrap": null, "_spec": "columnify@~1.5.1", "_where": "/Users/rebecca/code/npm", @@ -39,25 +39,26 @@ "url": "https://github.com/timoxley/columnify/issues" }, "dependencies": { - "strip-ansi": "^2.0.1", + "strip-ansi": "^3.0.0", "wcwidth": "^1.0.0" }, - "description": "Render data in text columns. supports in-column text-wrap.", + "description": "Render data in text columns. Supports in-column text-wrap.", "devDependencies": { - "babel": "^5.0.10", - "chalk": "^1.0.0", - "tap-spec": "^3.0.0", - "tape": "^4.0.0" + "babel": "^5.8.21", + "chalk": "^1.1.0", + "tap-spec": "^4.0.2", + "tape": "^4.0.3" }, "directories": { "test": "test" }, "dist": { - "shasum": "15fdda803a3875f87f9d302b3bc828932d664003", - "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz" + "shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz" }, - "gitHead": "1e5f5ec9478d7dbd1e3d1d74343b552da7ae01ba", + "gitHead": "e7417b78091844ff2f3ba62551a4817c7ae217bd", "homepage": "https://github.com/timoxley/columnify", + "installable": true, "keywords": [ "ansi", "column", @@ -87,5 +88,5 @@ "pretest": "npm prune", "test": "make prepublish && tape test/*.js | tap-spec" }, - "version": "1.5.1" + "version": "1.5.2" } |