minimal adjustments
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / table / dist / calculateCellWidthIndex.js
1 "use strict";
2
3 Object.defineProperty(exports, "__esModule", {
4   value: true
5 });
6 exports.default = void 0;
7
8 var _stringWidth = _interopRequireDefault(require("string-width"));
9
10 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12 /**
13  * Calculates width of each cell contents.
14  *
15  * @param {string[]} cells
16  * @returns {number[]}
17  */
18 const calculateCellWidthIndex = cells => {
19   return cells.map(value => {
20     return Math.max(...value.split('\n').map(line => {
21       return (0, _stringWidth.default)(line);
22     }));
23   });
24 };
25
26 var _default = calculateCellWidthIndex;
27 exports.default = _default;
28 //# sourceMappingURL=calculateCellWidthIndex.js.map