We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58277cf commit f4beb99Copy full SHA for f4beb99
1 file changed
app/utils/charts.ts
@@ -245,11 +245,7 @@ export function computeLineChartAnalysis(values: Array<number | null>): LineChar
245
}
246
247
if (n === 1) {
248
- let onlyValue = 0
249
- for (const entry of indexedValues) {
250
- onlyValue = entry.value
251
- }
252
-
+ const onlyValue = indexedValues[0]?.value ?? 0
253
return {
254
mean: onlyValue,
255
standardDeviation: 0,
@@ -512,8 +508,7 @@ export function createAltTextForTrendLineChart({
512
508
513
509
514
510
const granularityKey =
515
- granularityKeyByGranularity[config.granularity as unknown as string] ??
516
- 'package.trends.granularity_weekly'
511
+ granularityKeyByGranularity[config.granularity] ?? 'package.trends.granularity_weekly'
517
518
const granularity = String(config.$t(granularityKey)).toLocaleLowerCase()
519
0 commit comments