Skip to content

Commit 748e116

Browse files
committed
move URL to constants
1 parent 89e5c92 commit 748e116

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

apps/site/next-data/generators/vulnerabilities.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { VULNERABILITIES_URL } from '#site/next.constants.mjs';
2+
13
/**
24
* Groups vulnerabilities by major version number extracted from the `vulnerable` string.
35
*
@@ -30,9 +32,7 @@ function groupVulnerabilitiesByMajor(vulnerabilities) {
3032
* @returns {Promise<import('#site/types/vulnerabilities').GroupedVulnerabilities>} Grouped vulnerabilities
3133
*/
3234
export default async function generateVulnerabilityData() {
33-
const response = await fetch(
34-
'https://raw.githubusercontent.com/nodejs/security-wg/main/vuln/core/index.json'
35-
);
35+
const response = await fetch(VULNERABILITIES_URL);
3636

3737
const data = await response.json();
3838

apps/site/next.constants.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,9 @@ export const SEVERITY_KIND_MAP = {
195195
* Which Node.js versions do we want to display vulnerabilities for?
196196
*/
197197
export const EOL_VERSION_IDENTIFIER = 'End-of-life';
198+
199+
/**
200+
* The location of the Node.js Security Working Group Vulnerabilities data.
201+
*/
202+
export const VULNERABILITIES_URL =
203+
'https://raw.githubusercontent.com/nodejs/security-wg/main/vuln/core/index.json';

0 commit comments

Comments
 (0)