Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
printTable(tableArray) {
// tableArray[0] = array of column titles
// tableArray[1+] = array column values
let t = table.table(tableArray, {border: table.getBorderCharacters('ramac')});
Logger.info('\n' + t);
}
layouts.length > 0
? `${layouts.length} ${pluralize(layouts.length, 'layout', 'layouts')}`
: ''
// Log template and layout files
if (templates.length > 0) {
log(`\n${templatesLabel}`)
log(
table([templatesHeader, ...templates], {
border: getBorderCharacters('norc'),
})
)
}
if (layouts.length > 0) {
log(`\n${layoutsLabel}`)
log(table([header, ...layouts], { border: getBorderCharacters('norc') }))
}
// Log summary
log(
chalk.yellow(
`${templatesLabel}${
templates.length > 0 && layouts.length > 0 ? ' and ' : ''
}${layoutsLabel} will be pushed to Postmark.`
)
)
}
function logTable(rows: any[], style: "void" | "norc" = "norc") {
rows = removeWhitespace(rows);
console.log(
table(rows, {
border: getBorderCharacters(style),
columnDefault: {
truncate: 80
}
})
);
}
console.log(`The two jobs throughput is statistically ${chalk.bold('equal')}`)
} else {
console.log(`The two jobs throughput is ${chalk.bold('not')} statistically ${chalk.bold('equal')}`)
}
console.log('')
columns.unshift('Stat')
const out = table.table([
columns.map(k => chalk.cyan(k)),
row('req/s', results, keys, 'requests', chalk.green, chalk.red),
row('throughput', results, keys, 'throughput', chalk.green, chalk.red),
row('latency', results, keys, 'latency', chalk.red, chalk.green)
], {
border: table.getBorderCharacters('void'),
columnDefault: {
paddingLeft: 0,
paddingRight: 1
},
drawHorizontalLine: () => false
})
console.log(out)
}
});
if (!json)
return '';
if (!json.errors.length)
return '';
const output = [];
for (const {name, places} of json.errors) {
const line = buildLine(places);
output.push([
underline(name),
table(line, {
border: getBorderCharacters('void'),
drawHorizontalLine: () => false,
}),
].join('\n'));
}
output.push(bold(redBright(`✖ ${errorsCount} errors in ${filesCount} files`)));
output.push(bold(redBright(' fixable with the `--fix` option')));
return output.join('\n') + '\n';
};
let historyItems = this._getMaxItems();
tableHead.push.apply(tableHead, historyItems);
defaultTable.push(tableHead);
for(let i in this.peers){
let row = [];
for(let j in this.peers[i].info) {
row.push(strNormalize(this.peers[i].info[j]));
}
let historyValues = this._getMaxHistoryValues(historyItems, i);
row.push.apply(row, historyValues);
defaultTable.push(row);
}
let t = table.table(defaultTable, {border: table.getBorderCharacters('ramac')});
logger.info('\n ### resource stats (maximum) ###');
logger.info('\n' + t);
}
catch(err) {
logger.error('Failed to read monitoring data, ' + (err.stack ? err.stack : err));
}
}
function printTable(value) {
let t = table.table(value, {border: table.getBorderCharacters('ramac')});
logger.info('\n' + t);
}
line,
column,
} = position;
data.push([
grey(`${line}:${column}`),
`${red('error')} ${message}`,
grey(rule),
]);
}
if (data.length)
output.push([
underline(name),
table(data, {
border: getBorderCharacters('void'),
drawHorizontalLine: () => false,
}),
].join('\n'));
if (!output.length)
return '';
if (index === count - 1) {
const result = [
count === 1 ? output : '',
bold(redBright(`✖ ${errorsCount} errors in ${filesCount} files`)),
bold(redBright(' fixable with the `--fix` option')),
].filter(Boolean);
return result.join('\n') + '\n';
}
column,
} = getPosition(loc);
++errorsCount;
const msg = rendy(message, place);
data.push([
grey(`${line}:${column}`),
`${red('error')} ${msg}`,
]);
}
return [
underline(resolve(name)),
table(data, {
border: getBorderCharacters('void'),
drawHorizontalLine: () => false,
})
].join('\n');
}