25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
499 B

  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _stringWidth = require('string-width');
  6. var _stringWidth2 = _interopRequireDefault(_stringWidth);
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. /**
  9. * Calculates width of each cell contents.
  10. *
  11. * @param {string[]} cells
  12. * @returns {number[]}
  13. */
  14. exports.default = cells => {
  15. return cells.map(value => {
  16. return (0, _stringWidth2.default)(value);
  17. });
  18. };