diff --git a/lib/commands/info/index.js b/lib/commands/info/index.js index 70179796..023a909c 100644 --- a/lib/commands/info/index.js +++ b/lib/commands/info/index.js @@ -141,13 +141,8 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues }, spin } // Conclude the status of the API call - const severityCount = getSeverityCount(result.data, includeAllIssues ? undefined : 'high') - if (!objectSome(severityCount)) { - spinner.succeed('\nPackage has no issues') - } - return { data: result.data, severityCount, @@ -176,10 +171,15 @@ async function fetchPackageData (pkgName, pkgVersion, { includeAllIssues }, spin Object.entries(scoreResult).map(score => console.log(`- ${score[0]}: ${formatScore(score[1])}`)) // Package issues list - const issueSummary = formatSeverityCount(severityCount) - console.log('\n') - spinner[strict ? 'fail' : 'succeed'](`Package has these issues: ${issueSummary}`) - formatPackageIssuesDetails(data) + if (objectSome(severityCount)) { + const issueSummary = formatSeverityCount(severityCount) + console.log('\n') + spinner[strict ? 'fail' : 'succeed'](`Package has these issues: ${issueSummary}`) + formatPackageIssuesDetails(data) + } else { + console.log('\n') + spinner.succeed('Package has no issues') + } // Link to issues list const format = new ChalkOrMarkdown(!!outputMarkdown)