Skip to content

Commit

Permalink
Merge pull request #84 from biothings/empty-normalizer-response
Browse files Browse the repository at this point in the history
Handle empty responses from node normalizer
  • Loading branch information
tokebe committed Feb 18, 2022
2 parents 1c18cc0 + 8172b4a commit f182d61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ async function query(api_input: string[]) {
});
//convert res array into single object with all curies
let res = await Promise.all(axios_queries);
res = res.map(r => r.data);
res = res.map((r, i) => {
return Object.keys(r.data).length
? r.data
: Object.fromEntries(chunked_input[i].map(curie => [curie, null]));
});
return Object.assign({}, ...res);
} catch (err) {
err.message = `SRI resolver failed: ${err.message}`;
Expand Down

0 comments on commit f182d61

Please sign in to comment.