Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-03-07 08:00:38 +0300
committerRebecca Turner <me@re-becca.org>2017-03-25 02:23:50 +0300
commit95d4fc80a535dd11d176ca41558fc4ac1334a2cb (patch)
treecc91bd5662e358d87bd388fab1abeb3bdb224164
parent6400d3ac2101f5d3b11a7473f248bcb25e9596f5 (diff)
fetch-package-metadata: Support the _hasShrinkwrap registry metadata
Credit: @iarna PR-URL: https://github.com/npm/npm/pull/15969
-rw-r--r--lib/fetch-package-metadata.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fetch-package-metadata.js b/lib/fetch-package-metadata.js
index 76527b83d..bc1496f39 100644
--- a/lib/fetch-package-metadata.js
+++ b/lib/fetch-package-metadata.js
@@ -183,6 +183,10 @@ function retryWithCached (pkg, asserter, next) {
module.exports.addShrinkwrap = function addShrinkwrap (pkg, next) {
validate('OF', arguments)
if (pkg._shrinkwrap !== undefined) return next(null, pkg)
+ if (pkg._hasShrinkwrap === false) {
+ pkg._shrinkwrap = null
+ return next(null, pkg)
+ }
if (retryWithCached(pkg, addShrinkwrap, next)) return
pkg._shrinkwrap = null
// FIXME: cache the shrinkwrap directly