Skip to content

Commit f119054

Browse files
Copilotaegilops
andcommitted
Add proper type definitions for ComponentDetectionPackage constructor
Co-authored-by: aegilops <41705651+aegilops@users.noreply.github.com>
1 parent 22fde03 commit f119054

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/componentDetection.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,19 @@ export default class ComponentDetection {
364364
}
365365
}
366366

367+
/**
368+
* Type for referrer objects in topLevelReferrers array
369+
*/
370+
type TopLevelReferrer = {
371+
packageUrl?: any;
372+
packageUrlString?: string;
373+
};
374+
367375
class ComponentDetectionPackage extends Package {
368376
public packageUrlString: string;
369377

370-
constructor(packageUrl: string, public id: string, public isDevelopmentDependency: boolean, public topLevelReferrers: any[],
371-
public locationsFoundAt: any[], public containerDetailIds: any[], public containerLayerIds: any[]) {
378+
constructor(packageUrl: string, public id: string, public isDevelopmentDependency: boolean, public topLevelReferrers: TopLevelReferrer[],
379+
public locationsFoundAt: string[], public containerDetailIds: string[], public containerLayerIds: string[]) {
372380
super(packageUrl);
373381
this.packageUrlString = packageUrl;
374382
}

0 commit comments

Comments
 (0)