Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
is-only-optional: Read optional status from shrinkwrap when we have to
Browse files Browse the repository at this point in the history
  • Loading branch information
iarna committed Apr 12, 2018
1 parent b3f98d8 commit 9dea95e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/install/is-only-optional.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ function isOptional (node, seen) {
return false
}
seen.add(node)

const swOptional = node.fromShrinkwrap && node.package._optional
return node.requiredBy.every(function (req) {
if (req.fakeChild && swOptional) return true
return isOptDep(req, node.package.name) || isOptional(req, seen)
})
}

0 comments on commit 9dea95e

Please sign in to comment.