@pnpm/lockfile-utils
Advanced tools
Comparing version 4.0.10 to 4.1.0
import { Lockfile } from '@pnpm/lockfile-types'; | ||
import { ProjectManifest } from '@pnpm/types'; | ||
declare const _default: (lockfile: Lockfile, pkg: ProjectManifest, importerId: string) => boolean; | ||
declare const _default: (lockfile: Lockfile, pkg: ProjectManifest, importerId: string, opts?: { | ||
autoInstallPeers?: boolean; | ||
}) => boolean; | ||
export default _default; |
@@ -8,7 +8,21 @@ "use strict"; | ||
const equals_js_1 = __importDefault(require("ramda/src/equals.js")); | ||
exports.default = (lockfile, pkg, importerId) => { | ||
exports.default = (lockfile, pkg, importerId, opts) => { | ||
const importer = lockfile.importers[importerId]; | ||
if (!importer) | ||
return false; | ||
if (!(0, equals_js_1.default)({ ...pkg.devDependencies, ...pkg.dependencies, ...pkg.optionalDependencies }, importer.specifiers)) { | ||
let existingDeps = { ...pkg.devDependencies, ...pkg.dependencies, ...pkg.optionalDependencies }; | ||
if (opts?.autoInstallPeers) { | ||
existingDeps = { | ||
...pkg.peerDependencies, | ||
...existingDeps, | ||
}; | ||
pkg = { | ||
...pkg, | ||
dependencies: { | ||
...pkg.peerDependencies, | ||
...pkg.dependencies, | ||
}, | ||
}; | ||
} | ||
if (!(0, equals_js_1.default)(existingDeps, importer.specifiers)) { | ||
return false; | ||
@@ -15,0 +29,0 @@ } |
{ | ||
"name": "@pnpm/lockfile-utils", | ||
"version": "4.0.10", | ||
"version": "4.1.0", | ||
"description": "Utils for dealing with pnpm-lock.yaml", | ||
@@ -27,6 +27,6 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@pnpm/lockfile-utils": "4.0.10", | ||
"@types/js-yaml": "^4.0.0", | ||
"@pnpm/lockfile-utils": "4.1.0", | ||
"@types/js-yaml": "^4.0.5", | ||
"@types/ramda": "0.28.14", | ||
"tempy": "^1.0.0", | ||
"tempy": "^1.0.1", | ||
"write-yaml-file": "^4.2.0", | ||
@@ -33,0 +33,0 @@ "yaml-tag": "1.1.0" |
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
24014
313