Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
39
node_modules/table/dist/truncateTableData.js
generated
vendored
39
node_modules/table/dist/truncateTableData.js
generated
vendored
|
|
@ -1,30 +1,23 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _truncate2 = _interopRequireDefault(require("lodash/truncate"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.truncateTableData = exports.truncateString = void 0;
|
||||
const lodash_truncate_1 = __importDefault(require("lodash.truncate"));
|
||||
const truncateString = (input, length) => {
|
||||
return lodash_truncate_1.default(input, { length,
|
||||
omission: '…' });
|
||||
};
|
||||
exports.truncateString = truncateString;
|
||||
/**
|
||||
* @todo Make it work with ASCII content.
|
||||
* @param {table~row[]} rows
|
||||
* @param {Object} config
|
||||
* @returns {table~row[]}
|
||||
*/
|
||||
const truncateTableData = (rows, config) => {
|
||||
return rows.map(cells => {
|
||||
return cells.map((content, index) => {
|
||||
return (0, _truncate2.default)(content, {
|
||||
length: config.columns[index].truncate
|
||||
});
|
||||
return rows.map((cells) => {
|
||||
return cells.map((cell, cellIndex) => {
|
||||
return exports.truncateString(cell, config.columns[cellIndex].truncate);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var _default = truncateTableData;
|
||||
exports.default = _default;
|
||||
//# sourceMappingURL=truncateTableData.js.map
|
||||
exports.truncateTableData = truncateTableData;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue