Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
fix: try to adapt to yarn v3
Browse files Browse the repository at this point in the history
  • Loading branch information
davidzwa committed Jan 31, 2024
1 parent 541e0f0 commit 7587474
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,24 @@ export function fetchPackageVersions(workspace: string, packageName: string, use
latest: response["dist-tags"]?.latest,
};
} else {
return {
versions: response.data.versions,
latest: response.data["dist-tags"]?.latest,
};
if (response.data) {
return {
versions: response.data.versions,
latest: response.data["dist-tags"]?.latest,
};
} else {
if (response.children) {
const versions = response.children.map((c: any) => c["Version"]);
return {
versions: versions,
latest: versions?.length ? versions[0] : null,
};
} else {
return {
versions: response.data?.versions,
latest: response.data["dist-tags"]?.latest,
};
}
}
}
}

0 comments on commit 7587474

Please sign in to comment.