Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
row.forEach((cell, i) => {
let name
if (i < 4) {
name = names[i]
} else {
i -= 4
name = IDs[Math.floor(i / 2)].slice(0, 4)
name += i % 2 === 0 ? 'x' : 'y'
i += 4
}
t.cell(name, cell, i > 3 ? Table.number(2) : null)
})
t.newRow()
data.forEach(function (product) {
tasks.cell('Product Id', product.id)
tasks.cell('Description', product.desc)
tasks.cell('Price, USD', product.price, Table.number(2))
tasks.newRow()
})
console.log(tasks.toString())
let splitTech = client.config.hadesTech[techID].desc.split(" - ");
if ( lineBreaker != splitTech[0] ) {
if (dataTable.toString().length > 1800) {
msg[i++] = dataTable.sort(['Score|des']).toString()
dataTable = new table;
}
dataTable.cell('Tech', "--------------"+splitTech[0]+"-");
dataTable.cell('Level', "------");
dataTable.cell('Score', "-----");
dataTable.newRow();
lineBreaker = splitTech[0];
}
//dataTable.cell('Group', splitTech[0]);
dataTable.cell('Tech', splitTech[1]);
dataTable.cell('Level', " "+techLevel);
dataTable.cell('Score', client.config.hadesTech[techID].levels[Number(techLevel-1)], table.number(0));
dataTable.newRow();
}
});
if (!hasData) return message.reply("No data found");