style: auto-fix ESLint issues (curly braces and formatting)
- Add curly braces to all if/else/for/while statements - Fix indentation and trailing spaces - Auto-fixed 372 linting errors using eslint --fix - Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
@@ -13,14 +13,14 @@ function formatNumber(n) {
|
||||
}
|
||||
|
||||
function formatCost(n) {
|
||||
if (!n || n === 0) return '$0.00';
|
||||
if (n < 0.01) return `$${n.toFixed(4)}`;
|
||||
if (!n || n === 0) {return '$0.00';}
|
||||
if (n < 0.01) {return `$${n.toFixed(4)}`;}
|
||||
return `$${n.toFixed(2)}`;
|
||||
}
|
||||
|
||||
function truncateId(id) {
|
||||
if (!id) return '-';
|
||||
if (id.length <= 24) return id;
|
||||
if (!id) {return '-';}
|
||||
if (id.length <= 24) {return id;}
|
||||
return id.slice(0, 24) + '\u2026';
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ async function loadUsage(el, client) {
|
||||
let delegationCell = '<span class="text-muted">-</span>';
|
||||
if (delegationEntries.length > 0) {
|
||||
delegationCell = delegationEntries.map(([tier, stats]) =>
|
||||
`<span class="badge ok">${tier}</span> ${formatNumber(stats.inputTokens)}/${formatNumber(stats.outputTokens)}`
|
||||
`<span class="badge ok">${tier}</span> ${formatNumber(stats.inputTokens)}/${formatNumber(stats.outputTokens)}`,
|
||||
).join('<br>');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user