Skip to content

Commit 99f1761

Browse files
committed
scores are in the 0-100 range now
1 parent fa5e3ec commit 99f1761

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

index.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ server.tool(
164164
if (jsonData.score && jsonData.score.overall !== undefined) {
165165
const scoreEntries = Object.entries(jsonData.score)
166166
.filter(([key]) => key !== 'overall' && key !== 'uuid')
167-
.map(([key, value]) => `${key}: ${value}`)
167+
.map(([key, value]) => {
168+
const numValue = Number(value)
169+
const displayValue = numValue <= 1 ? Math.round(numValue * 100) : numValue
170+
return `${key}: ${displayValue}`
171+
})
168172
.join(', ')
169173

170174
results.push(`${purl}: ${scoreEntries}`)
@@ -178,7 +182,11 @@ server.tool(
178182
if (jsonData.score && jsonData.score.overall !== undefined) {
179183
const scoreEntries = Object.entries(jsonData.score)
180184
.filter(([key]) => key !== 'overall' && key !== 'uuid')
181-
.map(([key, value]) => `${key}: ${value}`)
185+
.map(([key, value]) => {
186+
const numValue = Number(value)
187+
const displayValue = numValue <= 1 ? Math.round(numValue * 100) : numValue
188+
return `${key}: ${displayValue}`
189+
})
182190
.join(', ')
183191

184192
results.push(`${purl}: ${scoreEntries}`)

0 commit comments

Comments
 (0)