Skip to content

Commit

Permalink
Fixes #661
Browse files Browse the repository at this point in the history
  • Loading branch information
marob committed Oct 23, 2023
1 parent 5a00176 commit b7270ad
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
Expand All @@ -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: [
Expand Down

0 comments on commit b7270ad

Please sign in to comment.