diff --git a/node/src/cli.ts b/node/src/cli.ts index eaed8861..7d4b49ca 100755 --- a/node/src/cli.ts +++ b/node/src/cli.ts @@ -146,7 +146,7 @@ const ignoreFileParser = z.array( z.object({ component: z.string(), version: z.string().optional(), - identifiers: z.record(z.string(), z.string()).optional(), + identifiers: z.record(z.string(), z.string().or(z.array(z.string()))).optional(), }), ), ), diff --git a/node/src/scanner.ts b/node/src/scanner.ts index 93a2aa76..ec3ada16 100644 --- a/node/src/scanner.ts +++ b/node/src/scanner.ts @@ -112,7 +112,9 @@ function removeIgnoredVulnerabilitiesByIdentifier(identifiers: Record, key: string, value: string | string[]) { if (!(key in identifiers)) return false; const identifier = identifiers[key]; - return Array.isArray(identifier) ? identifier.some((x) => x === value) : identifier === value; + const identifierArr = Array.isArray(identifier) ? identifier : [identifier]; + const valueArr = Array.isArray(value) ? value : [value]; + return identifierArr.some((id) => valueArr.includes(id)); } export function scanJsFile(file: string, repo: Repository, options: Options) {