diff --git a/lib/graph.ts b/lib/graph.ts index 0d85354..c01e58f 100644 --- a/lib/graph.ts +++ b/lib/graph.ts @@ -17,7 +17,7 @@ interface QueueItem { export async function buildGraph( snykGraph: SnykGraph, - projectName: string, + rootPkgName: string, projectVersion: string, coordinateMap?: CoordinateMap, ) { @@ -25,7 +25,7 @@ export async function buildGraph( const isEmptyGraph = !snykGraph || Object.keys(snykGraph).length === 0; const depGraphBuilder = new DepGraphBuilder(pkgManager, { - name: projectName, + name: rootPkgName, version: projectVersion || '0.0.0', }); diff --git a/lib/index.ts b/lib/index.ts index 742fc72..d6e7047 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -623,14 +623,14 @@ export async function processProjectsInExtractedJSON( const isSubProject = projectId !== defaultProjectKey; - let projectName = defaultProject; + let rootPkgName = defaultProject; if (isSubProject) { - projectName = `${defaultProject}/${projectId}`; + rootPkgName = `${defaultProject}/${projectId}`; } extractedJSON.projects[projectId].depGraph = await buildGraph( snykGraph, - projectName, + rootPkgName, projectVersion, coordinateMap, );