diff --git a/src/main.ts b/src/main.ts index d20871c..4431942 100644 --- a/src/main.ts +++ b/src/main.ts @@ -116,11 +116,9 @@ async function run(): Promise { } } if (vulnidColorized.length > 0 && vulnsevColorized.length > 0) { - const pkgTextPadding = Math.max(40 - v.PkgName.length, 0); - const pkgTxt = `${chalk.magenta(v.PkgName)}${new Array(pkgTextPadding).join(' ')}`; - const vulnidTxtPadding = Math.max(40 - v.VulnerabilityID.length, 0); - const vulnidTxt = `${vulnidColorized}${new Array(vulnidTxtPadding).join(' ')}`; - const vulnsevTxtPadding = Math.max(30 - v.Severity.length, 0); + const pkgTxt = `${chalk.magenta(v.PkgName).padEnd(40)}`; + const vulnidTxt = `${vulnidColorized.padEnd(40)}`; + const vulnsevTxt = `${vulnsevColorized.padEnd(30)}`; res.unhealthyMsg = `${pkgTxt} ${vulnidTxt} ${vulnsevTxt} ${v.Title}`; isUnhealthy = true; }