Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

truncateTableData.js 743B

123456789101112131415161718192021222324252627282930
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _lodash = _interopRequireDefault(require("lodash"));
  7. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  8. /**
  9. * @todo Make it work with ASCII content.
  10. * @param {table~row[]} rows
  11. * @param {Object} config
  12. * @returns {table~row[]}
  13. */
  14. const truncateTableData = (rows, config) => {
  15. return rows.map(cells => {
  16. return cells.map((content, index) => {
  17. return _lodash.default.truncate(content, {
  18. length: config.columns[index].truncate
  19. });
  20. });
  21. });
  22. };
  23. var _default = truncateTableData;
  24. exports.default = _default;
  25. //# sourceMappingURL=truncateTableData.js.map