diff --git a/src/lib/convert-issue-to-spdx.ts b/src/lib/convert-issue-to-spdx.ts index d751a93..32c36e1 100644 --- a/src/lib/convert-issue-to-spdx.ts +++ b/src/lib/convert-issue-to-spdx.ts @@ -12,13 +12,17 @@ function getVulnerabilityRating( const vulnerabilityRating: types.VulnerabilityRating = { method: issue.CVSSv3 ? 'CVSS_3' : undefined, // must be CVSS_2, CVSS_3, OWASP_RISK or OTHER score: [vulnerabilityRatingScore], - severity: issue.severity, // exploitability score of the vulnerability either None, Low, Medium, High or Critical + severity: capitalize(issue.severity), // exploitability score of the vulnerability either None, Low, Medium, High or Critical vector: issue.CVSSv3, }; return [vulnerabilityRating]; } +function capitalize(str: string) { + return str[0].toUpperCase() + str.slice(1); +} + function getExternalReferencesRelationships( references: types.SnykIssueReference[], ): types.ExternalReferencesRelationship[] { diff --git a/test/unit/lib/__snapshots__/convert-issue-to-spdx.spec.ts.snap b/test/unit/lib/__snapshots__/convert-issue-to-spdx.spec.ts.snap index ebc8653..fb8d294 100644 --- a/test/unit/lib/__snapshots__/convert-issue-to-spdx.spec.ts.snap +++ b/test/unit/lib/__snapshots__/convert-issue-to-spdx.spec.ts.snap @@ -108,7 +108,7 @@ Upgrade \`json\` to version 2.3.0 or higher. "impact": "<2.3.0", }, ], - "severity": "high", + "severity": "High", "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:H", }, ],