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.
46 lines
1.3 KiB
46 lines
1.3 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.createFilesTable = createFilesTable;
|
|
function _chalk() {
|
|
const data = _interopRequireDefault(require("chalk"));
|
|
_chalk = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
function _prettyBytes() {
|
|
const data = _interopRequireDefault(require("pretty-bytes"));
|
|
_prettyBytes = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
function _stripAnsi() {
|
|
const data = _interopRequireDefault(require("strip-ansi"));
|
|
_stripAnsi = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
function _textTable() {
|
|
const data = _interopRequireDefault(require("text-table"));
|
|
_textTable = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
function createFilesTable(files) {
|
|
const tableData = files.map((item, index) => {
|
|
const fileBranch = index === 0 ? '┌' : index === files.length - 1 ? '└' : '├';
|
|
return [`${fileBranch} ${item[0]}`, (0, _prettyBytes().default)(Buffer.byteLength(item[1], 'utf8'))];
|
|
});
|
|
return (0, _textTable().default)([['Bundle', 'Size'].map(v => _chalk().default.underline(v)), ...tableData], {
|
|
align: ['l', 'r'],
|
|
stringLength: str => (0, _stripAnsi().default)(str).length
|
|
});
|
|
}
|
|
//# sourceMappingURL=TableText.js.map
|