p2p fixes

This commit is contained in:
mrfry 2023-03-26 19:11:07 +02:00
parent 2edc87d5dd
commit 16d6f04936
17 changed files with 707 additions and 582 deletions

View file

@ -421,12 +421,13 @@ function C(color?: string): string {
function logTable(
table: (string | number)[][],
options: { colWidth?: number[] } = {}
options: { colWidth?: number[]; rowPrefix?: string } = {}
): void {
const { colWidth, rowPrefix } = options
table.forEach((row, i) => {
const rowString: string[] = []
row.forEach((cell, j) => {
const { colWidth } = options
const cellColor = j === 0 || i === 0 ? 'blue' : 'green'
let cellVal = ''
if (!isNaN(+cell)) {
@ -447,7 +448,7 @@ function logTable(
rowString.push(C(cellColor) + cellVal + C())
})
Log(rowString.join('\t'))
Log((rowPrefix || '') + rowString.join('\t'))
})
}