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.

17 lines
374 B

4 years ago
  1. import _ from 'lodash';
  2. /**
  3. * @todo Make it work with ASCII content.
  4. * @param {table~row[]} rows
  5. * @param {Object} config
  6. * @returns {table~row[]}
  7. */
  8. export default (rows, config) => {
  9. return rows.map((cells) => {
  10. return cells.map((content, index) => {
  11. return _.truncate(content, {
  12. length: config.columns[index].truncate
  13. });
  14. });
  15. });
  16. };