mirror of https://github.com/lukechilds/node.git
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.
35 lines
891 B
35 lines
891 B
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
|
|
var _truncate2 = require('lodash/truncate');
|
|
|
|
var _truncate3 = _interopRequireDefault(_truncate2);
|
|
|
|
var _map2 = require('lodash/map');
|
|
|
|
var _map3 = _interopRequireDefault(_map2);
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
/**
|
|
* @todo Make it work with ASCII content.
|
|
* @param {table~row[]} rows
|
|
* @param {Object} config
|
|
* @return {table~row[]}
|
|
*/
|
|
|
|
exports.default = function (rows, config) {
|
|
return (0, _map3.default)(rows, function (cells) {
|
|
return (0, _map3.default)(cells, function (content, index) {
|
|
return (0, _truncate3.default)(content, {
|
|
length: config.columns[index].truncate
|
|
});
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = exports['default'];
|
|
//# sourceMappingURL=truncateTableData.js.map
|
|
|