Add JS bundles

This commit is contained in:
Lane Seppala
2022-06-16 22:39:10 -06:00
parent 89ebd51ca6
commit 0a044ad723
2 changed files with 40 additions and 3 deletions
+39 -2
View File
@@ -75,8 +75,8 @@ function main() {
const packageCache = yield (0, process_1.processGoGraph)(goModDir);
const manifest = yield (0, process_1.processGoBuildTarget)(goModDir, goBuildTarget, packageCache);
const snapshot = new dependency_submission_toolkit_1.Snapshot({
name: 'github-go-dependency-detector',
url: 'https://github.com/github/github-go-dependency-detector',
name: 'actions/go-dependency-submission',
url: 'https://github.com/actions/go-dependency-submission',
version: '0.0.1'
}, github.context, {
correlator: `${github.context.job}-${goBuildTarget}`,
@@ -3590,6 +3590,17 @@ class PackageCache {
this.addPackage(dep);
return dep;
}
/**
* Provided a "matcher" object with any of the string fields 'namespace',
* 'name', or 'version', returns all packages matching fields specified by
* the matcher stored by the PackageCache
*
* @param {Object} matcher
* @returns {boolean}
*/
packagesMatching(matcher) {
return Object.values(this.database).filter((pkg) => pkg.matching(matcher));
}
/**
* addPackage adds a package, even if it already exists in the cache.
*
@@ -3708,6 +3719,15 @@ class Package {
packageID() {
return this.packageURL.toString();
}
/**
* namespace of the package
*
* @returns {string}
*/
namespace() {
var _a;
return (_a = this.packageURL.namespace) !== null && _a !== void 0 ? _a : null;
}
/**
* name of the package
*
@@ -3724,6 +3744,23 @@ class Package {
version() {
return this.packageURL.version || '';
}
/**
* Provided a "matcher" object with any of the string fields 'namespace',
* 'name', or 'version', returns true if the Package has values matching the
* matcher.
*
* @param {Object} matcher
* @returns {boolean}
*/
matching(matcher) {
// prettier-ignore
return ((matcher.namespace === undefined ||
this.packageURL.namespace === matcher.namespace) &&
(matcher.name === undefined ||
this.packageURL.name === matcher.name) &&
(matcher.version === undefined ||
this.packageURL.version === matcher.version));
}
}
exports.Package = Package;
//# sourceMappingURL=package.js.map
+1 -1
View File
File diff suppressed because one or more lines are too long