Skip to content

Commit f7ca235

Browse files
fix: return an object rather than array
1 parent 44a0b06 commit f7ca235

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/upgrade/assessmentManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getVersionRange(versions: Set<string>) : string {
3131
return `${versionList[0]}|${versionList[versionList.length - 1]}`;
3232
}
3333

34-
function collectVersionRange(pkgs: PackageDescription[]): [string, string][] {
34+
function collectVersionRange(pkgs: PackageDescription[]): Record<string, string> {
3535
const versionMap: Record<string, Set<string>> = {};
3636
for (const pkg of pkgs) {
3737
const groupId = pkg.groupId;
@@ -41,7 +41,7 @@ function collectVersionRange(pkgs: PackageDescription[]): [string, string][] {
4141
versionMap[groupId].add(pkg.version);
4242
}
4343

44-
return Object.entries(versionMap).map(([groupId, versions]) => [groupId, getVersionRange(versions)]);
44+
return Object.fromEntries(Object.entries(versionMap).map(([groupId, versions]) => [groupId, getVersionRange(versions)]));
4545
}
4646

4747
function getJavaIssues(data: INodeData): UpgradeIssue[] {
@@ -124,7 +124,7 @@ async function getDependencyIssues(projectNode: INodeData): Promise<UpgradeIssue
124124

125125
const issues = packages.map(getDependencyIssue).filter((x): x is UpgradeIssue => Boolean(x));
126126
const versionRangeByGroupId = collectVersionRange(packages.filter(getPackageUpgradeMetadata));
127-
if (versionRangeByGroupId.length > 0) {
127+
if (Object.keys(versionRangeByGroupId).length > 0) {
128128
sendInfo("", {
129129
operationName: "java.dependency.assessmentManager.getDependencyIssues",
130130
versionRangeByGroupId: JSON.stringify(versionRangeByGroupId),

0 commit comments

Comments
 (0)