Skip to content

Commit f4beb99

Browse files
committed
fix: apply coderabbit nitpicks
1 parent 58277cf commit f4beb99

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

app/utils/charts.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
245245
}
246246

247247
if (n === 1) {
248-
let onlyValue = 0
249-
for (const entry of indexedValues) {
250-
onlyValue = entry.value
251-
}
252-
248+
const onlyValue = indexedValues[0]?.value ?? 0
253249
return {
254250
mean: onlyValue,
255251
standardDeviation: 0,
@@ -512,8 +508,7 @@ export function createAltTextForTrendLineChart({
512508
}
513509

514510
const granularityKey =
515-
granularityKeyByGranularity[config.granularity as unknown as string] ??
516-
'package.trends.granularity_weekly'
511+
granularityKeyByGranularity[config.granularity] ?? 'package.trends.granularity_weekly'
517512

518513
const granularity = String(config.$t(granularityKey)).toLocaleLowerCase()
519514

0 commit comments

Comments
 (0)