diff options
author | Rebecca Turner <me@re-becca.org> | 2017-05-10 02:02:07 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:07 +0300 |
commit | 1e6cbc14042c427100e0ae5cd1234f73f2dcc0cf (patch) | |
tree | 22709866574fd48aba9bc6ad79f1524b4bc37be9 /lib | |
parent | 909943cc862cce1cd682086868126639baf52c3b (diff) |
inflate-shrinkwrap: Check link equivalency for shrinkwraped file specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/install/inflate-shrinkwrap.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/install/inflate-shrinkwrap.js b/lib/install/inflate-shrinkwrap.js index df83155e1..0a9e1c3c4 100644 --- a/lib/install/inflate-shrinkwrap.js +++ b/lib/install/inflate-shrinkwrap.js @@ -12,6 +12,7 @@ const normalizePackageData = require('normalize-package-data') const npm = require('../npm.js') const realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js') const validate = require('aproba') +const path = require('path') module.exports = function (tree, swdeps, finishInflating) { if (!npm.config.get('shrinkwrap')) return finishInflating() @@ -166,6 +167,8 @@ function childIsEquivalent (sw, requested, child) { if (!child) return false if (child.fromShrinkwrap) return true if (sw.integrity && child.package._integrity === sw.integrity) return true + if (child.isLink && requested.type === 'directory') return path.relative(child.realpath, requested.fetchSpec) === '' + if (sw.resolved) return child.package._resolved === sw.resolved if (!requested.registry && sw.from) return child.package._from === sw.from if (!requested.registry && child.package._resolved) return sw.version === child.package._resolved |