snyk-go-parser
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -14,15 +14,11 @@ "use strict"; | ||
function parseGoModGraph(goModGraphOutput, projectName, projectVersion = types_1.DEFAULT_INITIAL_VERSION) { | ||
var _a; | ||
const iterationReadyGraph = goModGraphOutput.trim().split('\n'); | ||
const moduleName = iterationReadyGraph[0].split(/\s/)[0]; | ||
const rootPkgInfo = { | ||
name: projectName.length ? projectName : '', | ||
name: projectName || moduleName, | ||
version: projectVersion, | ||
}; | ||
let depGraph = new dep_graph_1.DepGraphBuilder({ name: GO_MODULES }, rootPkgInfo); | ||
for (const line of goModGraphOutput.trim().split('\n')) { | ||
const depGraph = new dep_graph_1.DepGraphBuilder({ name: GO_MODULES }, rootPkgInfo); | ||
for (const line of iterationReadyGraph) { | ||
const [[parentName, parentVersion = types_1.DEFAULT_INITIAL_VERSION], [childName, childVersion],] = parseGoModGraphLine(line); | ||
if (!((_a = rootPkgInfo.name) === null || _a === void 0 ? void 0 : _a.length)) { | ||
rootPkgInfo.name = parentName; // On first iteration we populate w/ the module name | ||
// If we updated the package name, we should update to a new DepGraphBuilder | ||
depGraph = new dep_graph_1.DepGraphBuilder({ name: GO_MODULES }, rootPkgInfo); | ||
} | ||
const parentPkg = { name: parentName, version: parentVersion }; | ||
@@ -29,0 +25,0 @@ const childPkg = { |
@@ -50,3 +50,3 @@ { | ||
}, | ||
"version": "1.5.1" | ||
"version": "1.5.2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60816
218