Files
start-os/web/projects/ui/src/app/utils/dry-update.ts
Matt Hill 2e6e9635c3 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>
2025-04-12 09:53:03 -06:00

23 lines
617 B
TypeScript

import { Exver } from '@start9labs/shared'
import { DataModel } from '../services/patch-db/data-model'
import { getManifest } from './get-package-data'
export function dryUpdate(
{ id, version }: { id: string; version: string },
pkgs: DataModel['packageData'],
exver: Exver,
): string[] {
return Object.values(pkgs)
.filter(
pkg =>
Object.keys(pkg.currentDependencies || {}).some(
pkgId => pkgId === id,
) &&
!exver.satisfies(
version,
pkg.currentDependencies[id]?.versionRange || '',
),
)
.map(pkg => getManifest(pkg).title)
}