Skip to content

Commit

Permalink
fix: via link resolving for npm 7 using do-while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
p-v-d-Veeken committed Jun 15, 2021
1 parent 9701fb8 commit 5d07400
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ class Model {
let { via } = vulnerability;

if (typeof via[0] === "string") {
via = parsedOutput.vulnerabilities[via[0]].via;
do {
via = parsedOutput.vulnerabilities[via[index] || via[0]].via;
} while (typeof via[0] === "string");
(via[index] || via[0]).paths = `${vulnerability.name}>${
(via[index] || via[0]).name
}`;
Expand Down

0 comments on commit 5d07400

Please sign in to comment.