Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion node/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}),
),
),
Expand Down
4 changes: 3 additions & 1 deletion node/src/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ function removeIgnoredVulnerabilitiesByIdentifier(identifiers: Record<string, st
function hasIdentifier(identifiers: Record<string, string | string[]>, 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) {
Expand Down