From b7270add3305bea77bc88fbd0b8dfff6b40c5b91 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Mon, 23 Oct 2023 16:48:08 +0200 Subject: [PATCH] Fixes #661 --- utils.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index 7d95edd7e..52c7d2a6d 100644 --- a/utils.js +++ b/utils.js @@ -462,6 +462,13 @@ export const parsePkgLock = async (pkgLockFile, options = {}) => { let pkg = {}; let purlString = ""; + const author = node.package.author; + const authorString = + author instanceof Object + ? `${author.name}${author.email ? ` <${author.email}>` : ""}${ + author.url ? ` (${author.url})` : "" + }` + : author; if (node == rootNode) { purlString = new PackageURL( "npm", @@ -472,7 +479,7 @@ export const parsePkgLock = async (pkgLockFile, options = {}) => { null ).toString(); pkg = { - author: node.package.author, + author: authorString, group: options.projectGroup || "", name: options.projectName || node.packageName, version: options.projectVersion || node.version, @@ -497,7 +504,7 @@ export const parsePkgLock = async (pkgLockFile, options = {}) => { group: "", name: node.packageName, version: node.version, - author: node.package.author, + author: authorString, scope: scope, _integrity: integrity, properties: [