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

import _ from 'lodash';
/**
* @todo Make it work with ASCII content.
* @param {table~row[]} rows
* @param {Object} config
* @returns {table~row[]}
*/
export default (rows, config) => {
return rows.map((cells) => {
return cells.map((content, index) => {
return _.truncate(content, {
length: config.columns[index].truncate
});
});
});
};