Merge pull request #11582 from overleaf/jpa-count-tokens-empty-result

[access-token-encryptor] nicer log message for zero access token found

GitOrigin-RevId: 2a28fdc71a1e063f091f55bc247d9dd26bbd0ee3
This commit is contained in:
Jakob Ackermann 2023-02-01 12:14:36 +00:00 committed by Copybot
parent ac83dd9bb3
commit 246d62b578

View file

@ -14,7 +14,14 @@ function formatTokenUsageStats(STATS) {
.toFixed(2) .toFixed(2)
.padStart(6) .padStart(6)
} }
console.table(prettyStats)
if (prettyStats.length === 0) {
console.warn('---')
console.warn('Found 0 access tokens.')
console.warn('---')
} else {
console.table(prettyStats)
}
} }
module.exports = { formatTokenUsageStats } module.exports = { formatTokenUsageStats }