????JFIF??x?x????'
Server IP : 79.136.114.73 / Your IP : 18.117.114.211 Web Server : Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.29 OpenSSL/1.0.1f System : Linux b8009 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 User : www-data ( 33) PHP Version : 5.5.9-1ubuntu4.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/lib/node_modules/npm/node_modules/cli-table3/src/ |
Upload File : |
const utils = require('./utils'); const tableLayout = require('./layout-manager'); class Table extends Array { constructor(options) { super(); this.options = utils.mergeOptions(options); } toString() { let array = this; let headersPresent = this.options.head && this.options.head.length; if (headersPresent) { array = [this.options.head]; if (this.length) { array.push.apply(array, this); } } else { this.options.style.head = []; } let cells = tableLayout.makeTableLayout(array); cells.forEach(function (row) { row.forEach(function (cell) { cell.mergeTableOptions(this.options, cells); }, this); }, this); tableLayout.computeWidths(this.options.colWidths, cells); tableLayout.computeHeights(this.options.rowHeights, cells); cells.forEach(function (row) { row.forEach(function (cell) { cell.init(this.options); }, this); }, this); let result = []; for (let rowIndex = 0; rowIndex < cells.length; rowIndex++) { let row = cells[rowIndex]; let heightOfRow = this.options.rowHeights[rowIndex]; if (rowIndex === 0 || !this.options.style.compact || (rowIndex == 1 && headersPresent)) { doDraw(row, 'top', result); } for (let lineNum = 0; lineNum < heightOfRow; lineNum++) { doDraw(row, lineNum, result); } if (rowIndex + 1 == cells.length) { doDraw(row, 'bottom', result); } } return result.join('\n'); } get width() { let str = this.toString().split('\n'); return str[0].length; } } function doDraw(row, lineNum, result) { let line = []; row.forEach(function (cell) { line.push(cell.draw(lineNum)); }); let str = line.join(''); if (str.length) result.push(str); } module.exports = Table;