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 0dc4d51 commit ac17895Copy full SHA for ac17895
src/execution/execute.js
@@ -1093,15 +1093,11 @@ function completeListValue(
1093
function flattenEPRs(
1094
eprs: $ReadOnlyArray<ExecutionPartialResultNP<mixed>>,
1095
): ExecutionPartialResultNP<mixed> {
1096
- const errors = [];
1097
- const data = [];
1098
- for (let i = eprs.length - 1; i >= 0; i--) {
1099
- data[i] = eprs[i][0];
1100
- if (eprs[i][1] && eprs[i][1].length) {
1101
- errors.push(...eprs[i][1]);
1102
- }
1103
1104
- return [data, errors.length ? errors.reverse() : null];
+ const errors = eprs.reduce(
+ (m, i) => (i[1] && i[1].length ? [...m, ...i[1]] : m),
+ [],
+ );
+ return [eprs.map(i => i[0]), errors.length ? errors : null];
1105
}
1106
1107
/**
0 commit comments