Skip to content

Commit 33f25b3

Browse files
committed
Rework ComponentDetectionClass
1 parent e674ec5 commit 33f25b3

File tree

4 files changed

+8
-27
lines changed

4 files changed

+8
-27
lines changed

componentDetection.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class ComponentDetection {
7878

7979
// Set the transitive dependencies
8080
packages.forEach(async (pkg: ComponentDetectionPackage) => {
81-
pkg.toplevelReferrers.forEach(async (referrer: any) => {
81+
pkg.topLevelReferrers.forEach(async (referrer: any) => {
8282
const referrerPackage = packageCache.lookupPackage(ComponentDetection.makePackageUrl(referrer.packageUrl));
8383
if (referrerPackage) {
8484
referrerPackage.dependsOn(pkg);
@@ -97,7 +97,7 @@ export default class ComponentDetection {
9797
const manifest = new Manifest(location.filePath, location.filePath);
9898
manifests.push(manifest);
9999
}
100-
if (pkg.toplevelReferrers.length == 0) {
100+
if (pkg.topLevelReferrers.length == 0) {
101101
manifests.find((manifest: Manifest) => manifest.file == location.filePath)?.addDirectDependency(pkg, ComponentDetection.getDependencyScope(pkg));
102102
} else {
103103
manifests.find((manifest: Manifest) => manifest.file == location.filePath)?.addIndirectDependency(pkg, ComponentDetection.getDependencyScope(pkg)); }
@@ -153,22 +153,10 @@ export default class ComponentDetection {
153153

154154
class ComponentDetectionPackage extends Package {
155155

156-
constructor(packageUrl: string, id: string, isDevelopmentDependency:boolean, topLevelReferrers: [],
157-
locationsFoundAt: [], containerDetailIds: [], containerLayerIds: []) {
156+
constructor(packageUrl: string, public id: string, public isDevelopmentDependency:boolean, public topLevelReferrers: [],
157+
public locationsFoundAt: [], public containerDetailIds: [], public containerLayerIds: []) {
158158
super(packageUrl);
159-
this.id = id;
160-
this.isDevelopmentDependency = isDevelopmentDependency;
161-
this.toplevelReferrers = topLevelReferrers;
162-
this.locationsFoundAt = locationsFoundAt;
163-
this.containerDetailIds = containerDetailIds;
164-
this.containerLayerIds = containerLayerIds;
165159
}
166-
id: string;
167-
isDevelopmentDependency: boolean;
168-
toplevelReferrers: [];
169-
locationsFoundAt: [];
170-
containerDetailIds: [];
171-
containerLayerIds: [];
172160
}
173161

174162

dist/condaParser.d.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)