"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/src/lib/formatters/docker/format-docker-binary-issues.ts" (20 Feb 2024, 890 Bytes) of package /linux/misc/snyk-cli-1.1280.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 const values = require('lodash.values');
    2 import { createDockerBinaryHeading } from './format-docker-binary-heading';
    3 import { Options, TestOptions } from '../../../lib/types';
    4 import { formatIssues } from '../legacy-format-issue';
    5 
    6 export function formatDockerBinariesIssues(
    7   dockerBinariesSortedGroupedVulns,
    8   binariesVulns,
    9   options: Options & TestOptions,
   10 ): string[] {
   11   const binariesIssuesOutput = [] as string[];
   12   for (const pkgInfo of values(binariesVulns.affectedPkgs)) {
   13     binariesIssuesOutput.push(createDockerBinaryHeading(pkgInfo));
   14     const binaryIssues = dockerBinariesSortedGroupedVulns.filter(
   15       (vuln) => vuln.metadata.name === pkgInfo.pkg.name,
   16     );
   17     const formattedBinaryIssues = binaryIssues.map((vuln) =>
   18       formatIssues(vuln, options),
   19     );
   20     binariesIssuesOutput.push(formattedBinaryIssues.join('\n\n'));
   21   }
   22   return binariesIssuesOutput;
   23 }