Skip to content
This repository was archived by the owner on Jun 16, 2022. It is now read-only.

Go list implementation for detecting dependencies #5

Merged
merged 23 commits into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add NCC, compile
  • Loading branch information
lseppala authored May 14, 2022
commit a894776f8e8709cdea23ac79ac9465c95700c3ed
10 changes: 5 additions & 5 deletions dist/go_mod_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.parseDependents = void 0;
const processor_1 = require("@github/dependency-submission-toolkit/dist/processor");
function parseDependents(contents) {
const stdoutArr = contents.split("\n");
const stdoutArr = contents.split('\n');
const splitStdoutArr = stdoutArr.map(function (line) {
return line.split(" ");
return line.split(' ');
});
const entries = {};
const repoName = splitStdoutArr[0][0];
Expand All @@ -18,21 +18,21 @@ function parseDependents(contents) {
const dependencyPkg = `pkg:golang/${line[1]}`;
const matchFound = line[0].match(repoName);
if (matchFound && matchFound.index != null) {
entries[dependencyPkg] = new processor_1.Entry(dependencyPkg, "direct");
entries[dependencyPkg] = new processor_1.Entry(dependencyPkg, 'direct');
return;
}
if (targetPkg in entries) {
targetEntry = entries[targetPkg];
}
else {
targetEntry = new processor_1.Entry(targetPkg, "indirect");
targetEntry = new processor_1.Entry(targetPkg, 'indirect');
entries[targetPkg] = targetEntry;
}
if (dependencyPkg in entries) {
dependencyEntry = entries[dependencyPkg];
}
else {
dependencyEntry = new processor_1.Entry(dependencyPkg, "indirect");
dependencyEntry = new processor_1.Entry(dependencyPkg, 'indirect');
entries[dependencyPkg] = dependencyEntry;
}
targetEntry.addDependency(dependencyEntry);
Expand Down
Loading