We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f4482e commit 00b5b17Copy full SHA for 00b5b17
src/execution/execute.js
@@ -1098,15 +1098,11 @@ function completeListValue(
1098
function flattenEPRs(
1099
eprs: $ReadOnlyArray<ExecutionPartialResultNP<mixed>>,
1100
): ExecutionPartialResultNP<mixed> {
1101
- const errors = [];
1102
- const data = [];
1103
- for (let i = eprs.length - 1; i >= 0; i--) {
1104
- data[i] = eprs[i][0];
1105
- if (eprs[i][1] && eprs[i][1].length) {
1106
- errors.push(...eprs[i][1]);
1107
- }
1108
1109
- 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];
1110
}
1111
1112
/**
0 commit comments