From 9f42d9ce9121c7b86983f3b8f68b24e1b8ec8706 Mon Sep 17 00:00:00 2001 From: Alex Jurkiewicz Date: Fri, 17 Sep 2021 09:03:31 +1000 Subject: [PATCH] Use a template literal rather than concatenation --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 0e086fc..e01d985 100644 --- a/index.js +++ b/index.js @@ -229,12 +229,12 @@ const main = async () => { core.setOutput('ignored', ignored.toString()) core.setOutput('total', total.toString()) core.startGroup('Findings'); - findings_details.forEach(function(finding_detail,index){ + findings_details.forEach(function(finding_detail,index) { let finding_attributes = []; - finding_detail.attributes.forEach(function(attribute){ - finding_attributes.push(attribute.key+"="+attribute.value); + finding_detail.attributes.forEach(function(attribute) { + finding_attributes.push(`${attribute.key}=${attribute.value}`); }); - console.log(index+1 +'. '+finding_detail.name+' ('+finding_detail.severity+') '+finding_attributes.join(" ")); + console.log(`${index + 1}. ${finding_detail.name} (${finding_detail.severity}) ${finding_attributes.join(" ")}`); }); core.endGroup(); console.log('Vulnerabilities found:')