Skip to content

Commit e926936

Browse files
authored
fix: account for missing summary (#452)
1 parent 0f7069b commit e926936

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,14 @@ const processResults = ({ data, errors }) => {
219219
return {
220220
summary: data
221221
.map(({ path, url, summary, shortSummary, report }) => {
222-
const obj = {
223-
summary: summary.reduce((acc, item) => {
222+
const obj = { report };
223+
224+
if (summary) {
225+
obj.summary = summary.reduce((acc, item) => {
224226
acc[item.id] = item.score * 100;
225227
return acc;
226-
}, {}),
227-
report,
228-
};
228+
}, {});
229+
}
229230

230231
if (path) {
231232
obj.path = path;

0 commit comments

Comments
 (0)