fix a few, more to go (#2869)

* fix a few, more to go

* chore: comments (#2871)

* chore: comments

* chore: typo

* chore: stricter typescript (#2872)

* chore: comments

* chore: stricter typescript

---------

Co-authored-by: Matt Hill <MattDHill@users.noreply.github.com>

* minor styling

---------

Co-authored-by: Alex Inkin <alexander@inkin.ru>
This commit is contained in:
Matt Hill
2025-04-12 09:53:03 -06:00
committed by GitHub
parent 6a312e3fdd
commit 2e6e9635c3
55 changed files with 440 additions and 343 deletions

View File

@@ -249,20 +249,23 @@ export class MarketplaceService {
flavor: string | null,
pkgInfo: GetPackageRes,
): MarketplacePkg {
version =
const ver =
version ||
Object.keys(pkgInfo.best).find(v => this.exver.getFlavor(v) === flavor) ||
null
const best = ver && pkgInfo.best[ver]
return !version || !pkgInfo.best[version]
? ({} as MarketplacePkg)
: {
id,
version,
flavor,
...pkgInfo,
...pkgInfo.best[version],
}
if (!best) {
return {} as MarketplacePkg
}
return {
id,
flavor,
version: ver || '',
...pkgInfo,
...best,
}
}
getRequestErrors$(): Observable<string[]> {