Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@npmcli/arborist

Package Overview
Dependencies
Maintainers
5
Versions
193
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@npmcli/arborist - npm Package Compare versions

Comparing version 5.6.1 to 5.6.2

23

lib/add-rm-pkg-deps.js

@@ -8,2 +8,3 @@ // add and remove dependency specs to/from pkg manifest

for (const { name, rawSpec } of add) {
let addSaveType = saveType
// if the user does not give us a type, we infer which type(s)

@@ -13,7 +14,7 @@ // to keep based on the same order of priority we do when

// the node class.
if (!saveType) {
saveType = inferSaveType(pkg, name)
if (!addSaveType) {
addSaveType = inferSaveType(pkg, name)
}
if (saveType === 'prod') {
if (addSaveType === 'prod') {
// a production dependency can only exist as production (rpj ensures it

@@ -23,6 +24,6 @@ // doesn't coexist w/ optional)

deleteSubKey(pkg, 'peerDependencies', name, 'dependencies')
} else if (saveType === 'dev') {
} else if (addSaveType === 'dev') {
// a dev dependency may co-exist as peer, or optional, but not production
deleteSubKey(pkg, 'dependencies', name, 'devDependencies')
} else if (saveType === 'optional') {
} else if (addSaveType === 'optional') {
// an optional dependency may co-exist as dev (rpj ensures it doesn't

@@ -37,3 +38,3 @@ // coexist w/ prod)

const depType = saveTypeMap.get(saveType)
const depType = saveTypeMap.get(addSaveType)

@@ -44,3 +45,3 @@ pkg[depType] = pkg[depType] || {}

}
if (saveType === 'optional') {
if (addSaveType === 'optional') {
// Affordance for previous npm versions that require this behaviour

@@ -51,7 +52,7 @@ pkg.dependencies = pkg.dependencies || {}

if (saveType === 'peer' || saveType === 'peerOptional') {
if (addSaveType === 'peer' || addSaveType === 'peerOptional') {
const pdm = pkg.peerDependenciesMeta || {}
if (saveType === 'peer' && pdm[name] && pdm[name].optional) {
if (addSaveType === 'peer' && pdm[name] && pdm[name].optional) {
pdm[name].optional = false
} else if (saveType === 'peerOptional') {
} else if (addSaveType === 'peerOptional') {
pdm[name] = pdm[name] || {}

@@ -68,3 +69,3 @@ pdm[name].optional = true

if (saveBundle && saveType !== 'peer' && saveType !== 'peerOptional') {
if (saveBundle && addSaveType !== 'peer' && addSaveType !== 'peerOptional') {
// keep it sorted, keep it unique

@@ -71,0 +72,0 @@ const bd = new Set(pkg.bundleDependencies || [])

{
"name": "@npmcli/arborist",
"version": "5.6.1",
"version": "5.6.2",
"description": "Manage node_modules trees",

@@ -45,3 +45,3 @@ "dependencies": {

"@npmcli/eslint-config": "^3.1.0",
"@npmcli/template-oss": "3.8.0",
"@npmcli/template-oss": "4.1.1",
"benchmark": "^2.1.4",

@@ -60,5 +60,2 @@ "chalk": "^4.1.0",

"test-proxy": "ARBORIST_TEST_PROXY=1 tap --snapshot",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"eslint": "eslint",

@@ -108,4 +105,4 @@ "lint": "eslint \"**/*.js\"",

"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "3.8.0"
"version": "4.1.1"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc