@pnpm/lockfile-utils
Advanced tools
Comparing version 6.0.1 to 7.0.0
@@ -1,5 +0,6 @@ | ||
import { type Lockfile } from '@pnpm/lockfile-types'; | ||
import { type ProjectSnapshot } from '@pnpm/lockfile-types'; | ||
import { type ProjectManifest } from '@pnpm/types'; | ||
export declare function satisfiesPackageManifest(lockfile: Lockfile, pkg: ProjectManifest, importerId: string, opts?: { | ||
export declare function satisfiesPackageManifest(opts: { | ||
autoInstallPeers?: boolean; | ||
}): boolean; | ||
excludeLinksFromLockfile?: boolean; | ||
}, importer: ProjectSnapshot | undefined, pkg: ProjectManifest): boolean; |
@@ -9,5 +9,5 @@ "use strict"; | ||
const equals_1 = __importDefault(require("ramda/src/equals")); | ||
const pickBy_1 = __importDefault(require("ramda/src/pickBy")); | ||
const omit_1 = __importDefault(require("ramda/src/omit")); | ||
function satisfiesPackageManifest(lockfile, pkg, importerId, opts) { | ||
const importer = lockfile.importers[importerId]; | ||
function satisfiesPackageManifest(opts, importer, pkg) { | ||
if (!importer) | ||
@@ -29,2 +29,6 @@ return false; | ||
} | ||
const pickNonLinkedDeps = (0, pickBy_1.default)((spec) => !spec.startsWith('link:')); | ||
if (opts?.excludeLinksFromLockfile) { | ||
existingDeps = pickNonLinkedDeps(existingDeps); | ||
} | ||
if (!(0, equals_1.default)(existingDeps, importer.specifiers) || | ||
@@ -38,3 +42,6 @@ importer.publishDirectory !== pkg.publishConfig?.directory) { | ||
const importerDeps = importer[depField] ?? {}; | ||
const pkgDeps = pkg[depField] ?? {}; | ||
let pkgDeps = pkg[depField] ?? {}; | ||
if (opts?.excludeLinksFromLockfile) { | ||
pkgDeps = pickNonLinkedDeps(pkgDeps); | ||
} | ||
let pkgDepNames; | ||
@@ -41,0 +48,0 @@ switch (depField) { |
{ | ||
"name": "@pnpm/lockfile-utils", | ||
"version": "6.0.1", | ||
"version": "7.0.0", | ||
"description": "Utils for dealing with pnpm-lock.yaml", | ||
@@ -32,3 +32,3 @@ "main": "lib/index.js", | ||
"yaml-tag": "1.1.0", | ||
"@pnpm/lockfile-utils": "6.0.1" | ||
"@pnpm/lockfile-utils": "7.0.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25449
321