michael-s-molina commented on code in PR #31979:
URL: https://github.com/apache/superset/pull/31979#discussion_r1932583398


##########
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/utils.ts:
##########
@@ -35,10 +35,13 @@ const getFontSizeMapping = (
   proportionValues: number[],
   actualSizes: number[],
 ) =>
-  proportionValues.reduce((acc, value, index) => {
-    acc[value] = actualSizes[index] ?? actualSizes[actualSizes.length - 1];
-    return acc;
-  }, {});
+  proportionValues.reduce(
+    (acc, value, index) => {
+      acc[value] = actualSizes[index] ?? actualSizes[actualSizes.length - 1];
+      return acc;
+    },
+    {} as Record<number, number>,
+  );

Review Comment:
   The typed approach is better as it will add types to multiple parameters of 
the function:
   
   ```
   reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: 
number, array: T[])
    => U, initialValue: U): U;
   ``` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to