diff --git a/npm_and_yarn/helpers/lib/npm/vulnerability-auditor.js b/npm_and_yarn/helpers/lib/npm/vulnerability-auditor.js index e2394e5717..d58aeffef2 100644 --- a/npm_and_yarn/helpers/lib/npm/vulnerability-auditor.js +++ b/npm_and_yarn/helpers/lib/npm/vulnerability-auditor.js @@ -139,11 +139,6 @@ async function findVulnerableDependencies(directory, advisories) { } function convertAdvisoriesToRegistryBulkFormat(advisories) { - // npm audit differentiates advisories by `id`. In order to prevent - // advisories from being clobbered, we maintain a counter so that each - // advisory gets a unique `id`. - let nextAdvisoryId = 1 - return advisories.reduce((formattedAdvisories, advisory) => { if (!formattedAdvisories[advisory.dependency_name]) { formattedAdvisories[advisory.dependency_name] = [] @@ -151,7 +146,7 @@ function convertAdvisoriesToRegistryBulkFormat(advisories) { let formattedVersions = advisory.affected_versions.reduce((memo, version) => { memo.push({ - id: nextAdvisoryId++, + id: Math.floor(Math.random() * Number.MAX_SAFE_INTEGER), vulnerable_versions: version }) return memo