"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1280.1/packages/snyk-fix/src/lib/output-formatters/format-failed-item.ts" (20 Feb 2024, 554 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 import { FailedToFix, isWithError } from '../../plugins/types';
    2 
    3 import { convertErrorToUserMessage } from '../errors/error-to-user-message';
    4 import { formatChangesSummary } from './format-with-changes-item';
    5 import { formatUnresolved } from './format-unresolved-item';
    6 
    7 export function formatFailed(failed: FailedToFix): string {
    8   if (isWithError(failed)) {
    9     return formatUnresolved(
   10       failed.original,
   11       convertErrorToUserMessage(failed.error),
   12       failed.tip,
   13     );
   14   }
   15   return formatChangesSummary(failed.original, failed.changes);
   16 }