Sha256: 195f7f336f323d5ab9ce6239b644c78cb973d24cbdfd34eb08aa9c6c13534586

Contents?: true

Size: 689 Bytes

Versions: 23

Compression:

Stored size: 689 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _stringWidth = _interopRequireDefault(require("string-width"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Calculates width of each cell contents.
 *
 * @param {string[]} cells
 * @returns {number[]}
 */
const calculateCellWidthIndex = cells => {
  return cells.map(value => {
    return Math.max(...value.split('\n').map(line => {
      return (0, _stringWidth.default)(line);
    }));
  });
};

var _default = calculateCellWidthIndex;
exports.default = _default;
//# sourceMappingURL=calculateCellWidthIndex.js.map

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.6 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.5 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.4 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.3 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.2 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.1 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3.5 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-5.0.0 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3.4 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3.3 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3.2 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3.1 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.3 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.2.3 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.2.2 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.2.1 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.2 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.1.9 node_modules/table/dist/calculateCellWidthIndex.js
trusty-cms-4.1.8 node_modules/table/dist/calculateCellWidthIndex.js