diff --git a/bin/index.js b/bin/index.js index 1887b2b0..b94e1316 100755 --- a/bin/index.js +++ b/bin/index.js @@ -55,7 +55,7 @@ defaultScannerCommand("from ") await commands.scanner.from(...options); }); -defaultScannerCommand("auto [package]", { includeOutput: false, strategy: vuln.strategies.SECURITY_WG }) +defaultScannerCommand("auto [package]", { includeOutput: false, strategy: vuln.strategies.NPM_AUDIT }) .describe(i18n.getTokenSync("cli.commands.auto.desc")) .option("-k, --keep", i18n.getTokenSync("cli.commands.auto.option_keep"), false) .action(commands.scanner.auto); diff --git a/esbuild.config.js b/esbuild.config.js index 1e780b8d..7b295479 100644 --- a/esbuild.config.js +++ b/esbuild.config.js @@ -41,7 +41,7 @@ await Promise.all([ "github-mark.png", "github-black.png", "npm-icon.svg", - "nodejs.png", + "node.png", "snyk.png", "sonatype.png", "avatar-default.png", diff --git a/public/img/nodejs.png b/public/img/node.png similarity index 100% rename from public/img/nodejs.png rename to public/img/node.png diff --git a/public/js/components/package/pannels/overview.js b/public/js/components/package/pannels/overview.js index 0eac48f8..eb3449ab 100644 --- a/public/js/components/package/pannels/overview.js +++ b/public/js/components/package/pannels/overview.js @@ -16,7 +16,7 @@ export class Overview { get author() { const author = this.package.dependencyVersion.author; - if (author === null) { + if (author === null || !("name" in author)) { return "Unknown"; } diff --git a/public/js/utils.js b/public/js/utils.js index 39d099ed..6624af6a 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -61,7 +61,21 @@ export function parseRepositoryUrl(repository = {}, defaultValue = null) { if (repository.url.startsWith("git://")) { return `https${repository.url.slice(3)}`; } - return repository.url; + if (repository.url.startsWith("git@")) { + const execResult = /git@(?[a-zA-Z.]+):(?.+)\.git/gm.exec(repository.url); + if (execResult === null) { + return defaultValue; + } + + return `https://${execResult.groups.platform}/${execResult.groups.repo}`; + } + + try { + return new URL(repository.url).href; + } + catch { + return defaultValue; + } } export function createAvatarImageElement(email = null) {