3 Object.defineProperty(exports, "__esModule", {
7 var _calculateCellWidthIndex = require('./calculateCellWidthIndex');
9 var _calculateCellWidthIndex2 = _interopRequireDefault(_calculateCellWidthIndex);
11 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14 * Produces an array of values that describe the largest value length (width) in every column.
16 * @param {Array[]} rows
19 exports.default = rows => {
21 throw new Error('Dataset must have at least one row.');
24 const columns = Array(rows[0].length).fill(0);
27 const columnWidthIndex = (0, _calculateCellWidthIndex2.default)(row);
29 columnWidthIndex.forEach((valueWidth, index0) => {
30 if (columns[index0] < valueWidth) {
31 columns[index0] = valueWidth;