summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/inflate-shrinkwrap.js
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-12-07 14:05:23 -0800
committerMyles Borins <mylesborins@google.com>2018-01-19 11:32:08 -0500
commitd3b1c971bcf0177b17c649c3aeca1a94cbc3fff5 (patch)
tree321928c015be00cdbe11715297d2d2fc45802263 /deps/npm/lib/install/inflate-shrinkwrap.js
parentbfe41fe88e7421f441067a79fb7512cf5935a2bb (diff)
downloadandroid-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.tar.gz
android-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.tar.bz2
android-node-v8-d3b1c971bcf0177b17c649c3aeca1a94cbc3fff5.zip
deps: upgrade npm to 5.6.0
PR-URL: https://github.com/nodejs/node/pull/17777 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'deps/npm/lib/install/inflate-shrinkwrap.js')
-rw-r--r--deps/npm/lib/install/inflate-shrinkwrap.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js
index 48be93d095..43ac9136f0 100644
--- a/deps/npm/lib/install/inflate-shrinkwrap.js
+++ b/deps/npm/lib/install/inflate-shrinkwrap.js
@@ -13,6 +13,7 @@ const npm = require('../npm.js')
const realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js')
const validate = require('aproba')
const path = require('path')
+const isRegistry = require('../utils/is-registry.js')
module.exports = function (tree, sw, opts, finishInflating) {
if (!fetchPackageMetadata) {
@@ -147,7 +148,7 @@ function adaptResolved (requested, resolved) {
const registry = requested.scope
? npm.config.get(`${requested.scope}:registry`) || npm.config.get('registry')
: npm.config.get('registry')
- if (!requested.registry || (resolved && resolved.indexOf(registry) === 0)) {
+ if (!isRegistry(requested) || (resolved && resolved.indexOf(registry) === 0)) {
// Nothing to worry about here. Pass it through.
return resolved
} else {
@@ -199,7 +200,7 @@ function childIsEquivalent (sw, requested, child) {
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
+ if (!isRegistry(requested) && sw.from) return child.package._from === sw.from
+ if (!isRegistry(requested) && child.package._resolved) return sw.version === child.package._resolved
return child.package.version === sw.version
}