Skip to content

Commit

Permalink
use templates instead of a mix with concatenation
Browse files Browse the repository at this point in the history
Signed-off-by: Alfredo Deza <adeza@anchore.com>
  • Loading branch information
Alfredo Deza authored and alfredodeza committed Mar 29, 2021
1 parent 3ebdaf7 commit b4624c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Expand Up @@ -53,14 +53,14 @@ function getLocation(v) {
}

function textMessage(v) {
let path = getLocation(v);
const path = getLocation(v);
var scheme = sourceScheme();
let prefix = `The path ${path} reports ${v.artifact.name} at version ${v.artifact.version} `;

if (["dir", "tar"].includes(scheme)) {
return prefix + ` which would result in a vulnerable (${v.artifact.type}) package installed`;
return `${prefix} which would result in a vulnerable (${v.artifact.type}) package installed`;
} else {
return prefix + `which is a vulnerable (${v.artifact.type}) package installed in the container`;
return `${prefix} which is a vulnerable (${v.artifact.type}) package installed in the container`;
}
}

Expand Down
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -46,14 +46,14 @@ function getLocation(v) {
}

function textMessage(v) {
let path = getLocation(v);
const path = getLocation(v);
var scheme = sourceScheme();
let prefix = `The path ${path} reports ${v.artifact.name} at version ${v.artifact.version} `;

if (["dir", "tar"].includes(scheme)) {
return prefix + ` which would result in a vulnerable (${v.artifact.type}) package installed`;
return `${prefix} which would result in a vulnerable (${v.artifact.type}) package installed`;
} else {
return prefix + `which is a vulnerable (${v.artifact.type}) package installed in the container`;
return `${prefix} which is a vulnerable (${v.artifact.type}) package installed in the container`;
}
}

Expand Down

0 comments on commit b4624c8

Please sign in to comment.