diff options
author | Ruy Adorno <ruyadorno@hotmail.com> | 2021-02-08 22:35:56 +0300 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-02-08 23:24:48 +0300 |
commit | 27be528ebb9801f8cccbfd30c19ddea4537adf8a (patch) | |
tree | 4241efb0b6d3e2c9637a519eb9170bbef80059d3 /lib | |
parent | 9ab36aae429784df754211d5f086a515012b9bdd (diff) |
fix: prune optionalDeps ls compat
Fixes a compatibility issue in `npm ls` due to the subtle internal
change of optional dependencies being pruned from dependencies in
`read-package-json-fast@2.0.0` update.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ls.js | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -163,7 +163,10 @@ const getJsonOutputItem = (node, { global, long }) => { Object.assign(item, packageInfo) item.extraneous = false item.path = node.path - item._dependencies = node.package.dependencies || {} + item._dependencies = { + ...node.package.dependencies, + ...node.package.optionalDependencies, + } item.devDependencies = node.package.devDependencies || {} item.peerDependencies = node.package.peerDependencies || {} } |