Copilot commented on code in PR #3296:
URL: 
https://github.com/apache/incubator-kie-tools/pull/3296#discussion_r2405521818


##########
packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx:
##########
@@ -465,10 +471,14 @@ function OutputsBeeTable({
         if (result !== null && !Array.isArray(result) && typeof result === 
"object") {
           columnResults = deepFlattenObjectRow(result);
         } else {
+          const extractedRowValue = getRowValue(result);
           if (headerColumn.dataType === "context") {
-            columnResults = { context: getRowValue(result) };
+            columnResults = { context: extractedRowValue };
           } else {
-            columnResults = { [`${decisionName}`]: getRowValue(result) };
+            columnResults = { [`${decisionName}`]: extractedRowValue };
+          }
+          if (Array.isArray(extractedRowValue)) {
+            extractedRowValue.forEach((elementValue, index) => 
(columnResults[`[${index}]`] = elementValue));
           }

Review Comment:
   The array element assignment uses a side effect in the forEach callback. 
Consider using a for loop or explicitly mutating the object for better 
readability and maintainability.
   ```suggestion
               for (let index = 0; index < extractedRowValue.length; index++) {
                 columnResults[`[${index}]`] = extractedRowValue[index];
               }
   ```



-- 
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