diff options
Diffstat (limited to 'deps/npm/lib/install/is-only-optional.js')
-rw-r--r-- | deps/npm/lib/install/is-only-optional.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/deps/npm/lib/install/is-only-optional.js b/deps/npm/lib/install/is-only-optional.js index f1b731578d..81e227bae7 100644 --- a/deps/npm/lib/install/is-only-optional.js +++ b/deps/npm/lib/install/is-only-optional.js @@ -2,6 +2,7 @@ module.exports = isOptional const isOptDep = require('./is-opt-dep.js') +const moduleName = require('../utils/module-name.js') function isOptional (node, seen) { if (!seen) seen = new Set() @@ -15,6 +16,6 @@ function isOptional (node, seen) { 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) + return isOptDep(req, moduleName(node)) || isOptional(req, seen) }) } |