revamp manifest types

This commit is contained in:
Matt Hill
2024-03-21 17:21:37 -06:00
parent ab836c6922
commit 66b0108c51
43 changed files with 279 additions and 834 deletions

View File

@@ -1,8 +1,8 @@
import { PackageDataEntry } from '../services/patch-db/data-model'
import { getManifest } from './get-package-data'
export function hasCurrentDeps(pkg: PackageDataEntry): boolean {
return !!Object.keys(pkg['current-dependents']).filter(
depId => depId !== getManifest(pkg).id,
).length
export function hasCurrentDeps(
id: string,
pkgs: Record<string, PackageDataEntry>,
): boolean {
return !!Object.values(pkgs).some(pkg => !!pkg['current-dependencies'][id])
}