blob: e2539539a5d15db1c562a6ff6b1c9ee343009d0f [file] [edit]
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);
}),
);
});
};