From 59e97b7dd5922d144298967e6ea200a9782bb9ba Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Tue, 24 Dec 2024 12:51:18 +0000 Subject: [PATCH] Lint fixes Signed-off-by: Prabhu Subramanian --- lib/cli/index.js | 43 ++++++++++++++++++++---------------- types/lib/cli/index.d.ts.map | 2 +- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lib/cli/index.js b/lib/cli/index.js index 622fddb0e..7f162a061 100644 --- a/lib/cli/index.js +++ b/lib/cli/index.js @@ -2539,26 +2539,31 @@ export async function createNodejsBom(path, options) { const dlist = parsedList.pkgList; let tmpParentComponent = dlist.splice(0, 1)[0] || {}; if (!Object.keys(parentComponent).length) { - const basePath = dirname(f); - const packageJsonF = join(basePath, "package.json"); - if (existsSync(packageJsonF)) { - const pcs = await parsePkgJson(packageJsonF, true); - if (pcs.length) { - tmpParentComponent = pcs[0]; - tmpParentComponent.type = "application"; - tmpParentComponent.name = "project-name" in options ? options.projectName : tmpParentComponent.name; - ppurl = new PackageURL( - "npm", - options.projectGroup || tmpParentComponent.group, - "project-name" in options ? options.projectName : tmpParentComponent.name, - options.projectVersion || tmpParentComponent.version, - null, - null, - ).toString(); - tmpParentComponent["bom-ref"] = decodeURIComponent(ppurl); - tmpParentComponent["purl"] = ppurl; - } + const basePath = dirname(f); + const packageJsonF = join(basePath, "package.json"); + if (existsSync(packageJsonF)) { + const pcs = await parsePkgJson(packageJsonF, true); + if (pcs.length) { + tmpParentComponent = pcs[0]; + tmpParentComponent.type = "application"; + tmpParentComponent.name = + "project-name" in options + ? options.projectName + : tmpParentComponent.name; + ppurl = new PackageURL( + "npm", + options.projectGroup || tmpParentComponent.group, + "project-name" in options + ? options.projectName + : tmpParentComponent.name, + options.projectVersion || tmpParentComponent.version, + null, + null, + ).toString(); + tmpParentComponent["bom-ref"] = decodeURIComponent(ppurl); + tmpParentComponent["purl"] = ppurl; } + } parentComponent = tmpParentComponent; } else { parentSubComponents.push(tmpParentComponent); diff --git a/types/lib/cli/index.d.ts.map b/types/lib/cli/index.d.ts.map index 9991b44b3..8b0752e9f 100644 --- a/types/lib/cli/index.d.ts.map +++ b/types/lib/cli/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA4wBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AA8WD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAs7BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6iBhB;AAED;;;;;;;;;;GAUG;AACH,+DAsEC;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6bhB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,8BA+YhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAqIhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAiDhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBA+KhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBAsHhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,0CAHW,MAAM,qBAuBhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,8BAqDhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,8BA4ChB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,qCAHW,MAAM,8BA6FhB;AAED;;;;;GAKG;AACH,iDAHW,MAAM,qBAiUhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBAiJhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAmFhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA4XhB;AAED;;;;;GAKG;AACH,2CAHW,MAAM;;;;;;;;;;;;;;;;;;;;GAoChB;AAED;;;;;;;;KA+DC;AAED;;;;;;GAMG;AACH,yDA4EC;AAED;;;;;;;;;GASG;AACH,2GA6BC;AAED;;;;;GAKG;AACH,0CAHW,MAAM,EAAE,8BAqdlB;AAED;;;;;GAKG;AACH,iCAHW,MAAM,8BAgUhB;AAED;;;;;GAKG;AACH,gCAHW,MAAM,qBAqOhB;AAED;;;;;;GAMG;AACH,wDAFY,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAAC,CAwHxE"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/cli/index.js"],"names":[],"mappings":"AA4wBA;;;;;;;;GAQG;AACH,gFAFW,MAAM,SAchB;AA8WD;;;;;;;GAOG;AACH,mCALW,MAAM,qBAiEhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM;;;;EAKhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM;;;;EAkBhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAs7BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BAqkBhB;AAED;;;;;;;;;;GAUG;AACH,+DAsEC;AAED;;;;;GAKG;AACH,sCAHW,MAAM,8BA6bhB;AAED;;;;;GAKG;AACH,kCAHW,MAAM,8BA+YhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAqIhB;AAED;;;;;GAKG;AACH,oCAHW,MAAM,8BAiDhB;AAED;;;;;GAKG;AACH,mCAHW,MAAM,qBA+KhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBAsHhB;AAED;;;;;GAKG;AACH,uCAHW,MAAM,qBA2BhB;AAED;;;;;GAKG;AACH,sCAHW,MAAM,qBA2BhB;AAED;;;;;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