mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
* 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>
23 lines
617 B
TypeScript
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)
|
|
}
|