refactor: remove useless code from pruneLockfile (#7680)

This commit is contained in:
Khải authored and GitHub committed 2024-02-20 10:47:37 +01:00
1 parent e4caa114ac
commit 7cb3cfb5ba
1 file changed
-4
-4
View File
@@ -46,7 +46,6 @@ export function pruneLockfile (
warn?: (msg: string) => void
}
): Lockfile {
const packages: PackageSnapshots = {}
const importer = lockfile.importers[importerId]
const lockfileSpecs: ResolvedDependencies = importer.specifiers ?? {}
const optionalDependencies = Object.keys(pkg.optionalDependencies ?? {})
@@ -97,9 +96,6 @@ export function pruneLockfile (
lockfileVersion: lockfile.lockfileVersion || LOCKFILE_VERSION,
packages: lockfile.packages,
}
if (!isEmpty(packages)) {
prunedLockfile.packages = packages
}
if (!isEmpty(lockfileDependencies)) {
updatedImporter.dependencies = lockfileDependencies
}