Socket
Socket
Sign inDemoInstall

table

Package Overview
Dependencies
4
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.3 to 6.0.4

13

dist/createStream.js

@@ -10,6 +10,2 @@ "use strict";

var _values2 = _interopRequireDefault(require("lodash/values"));
var _trimEnd2 = _interopRequireDefault(require("lodash/trimEnd"));
var _alignTableData = _interopRequireDefault(require("./alignTableData"));

@@ -68,3 +64,3 @@

output += (0, _drawBorder.drawBorderBottom)(columnWidthIndex, config.border);
output = (0, _trimEnd2.default)(output);
output = output.trimEnd();
process.stdout.write(output);

@@ -95,3 +91,3 @@ };

output += bottom;
output = (0, _trimEnd2.default)(output);
output = output.trimEnd();
process.stdout.write(output);

@@ -106,5 +102,4 @@ };

const createStream = (userConfig = {}) => {
const config = (0, _makeStreamConfig.default)(userConfig); // @todo Use 'Object.values' when Node.js v6 support is dropped.
const columnWidthIndex = (0, _values2.default)((0, _mapValues2.default)(config.columns, column => {
const config = (0, _makeStreamConfig.default)(userConfig);
const columnWidthIndex = Object.values((0, _mapValues2.default)(config.columns, column => {
return column.width + column.paddingLeft + column.paddingRight;

@@ -111,0 +106,0 @@ }));

@@ -8,3 +8,3 @@ "use strict";

enumerable: true,
get: function get() {
get: function () {
return _createStream.default;

@@ -15,3 +15,3 @@ }

enumerable: true,
get: function get() {
get: function () {
return _getBorderCharacters.default;

@@ -22,3 +22,3 @@ }

enumerable: true,
get: function get() {
get: function () {
return _table.default;

@@ -25,0 +25,0 @@ }

@@ -8,8 +8,2 @@ "use strict";

function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/**

@@ -42,39 +36,17 @@ * @typedef {string} cell

var _iterator = _createForOfIteratorHelper(rows),
_step;
for (const cells of rows) {
if (!Array.isArray(cells)) {
throw new TypeError('Table row data must be an array.');
}
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
const cells = _step.value;
if (cells.length !== columnNumber) {
throw new Error('Table must have a consistent number of cells.');
}
if (!Array.isArray(cells)) {
throw new TypeError('Table row data must be an array.');
for (const cell of cells) {
// eslint-disable-next-line no-control-regex
if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) {
throw new Error('Table data must not contain control characters.');
}
if (cells.length !== columnNumber) {
throw new Error('Table must have a consistent number of cells.');
}
var _iterator2 = _createForOfIteratorHelper(cells),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
const cell = _step2.value;
// eslint-disable-next-line no-control-regex
if (/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test(cell)) {
throw new Error('Table data must not contain control characters.');
}
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

@@ -81,0 +53,0 @@ };

@@ -83,3 +83,3 @@ {

},
"version": "6.0.3"
"version": "6.0.4"
}

@@ -490,3 +490,3 @@ <a name="table"></a>

# void (no borders; see "bordless table" section of the documentation)
# void (no borders; see "borderless table" section of the documentation)

@@ -493,0 +493,0 @@ 0A 0B 0C

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc