Your IP : 216.73.216.40


Current Path : /var/www/html/test/wetty2/node_modules/table/dist/
Upload File :
Current File : /var/www/html/test/wetty2/node_modules/table/dist/calculateCellWidthIndex.js.flow

import stringWidth from 'string-width';

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