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>2015-06-18 18:32:59 +0300
committerRebecca Turner <me@re-becca.org>2015-06-26 03:27:29 +0300
commit9e030f7426958c8df7f292acc823d97d979916fd (patch)
tree498747ca580c6fa61182df66341afec55dd0c976
parentf10ed2f3e2eb4b1b3435f9731594a0f496569760 (diff)
publish: Throw an error if the bundled deps package.json entry is invalid
-rw-r--r--lib/utils/tar.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/tar.js b/lib/utils/tar.js
index 3d0557e68..59ade0e24 100644
--- a/lib/utils/tar.js
+++ b/lib/utils/tar.js
@@ -137,6 +137,12 @@ function nameMatch (name) { return function (other) { return name === other.pack
BundledPacker.prototype.isBundled = function (name) {
var bd = this.package && this.package.bundleDependencies
if (!bd) return false
+
+ if (!Array.isArray(bd)) {
+ throw new Error(this.package.name + '\'s `bundledDependencies` should ' +
+ 'be an array')
+ }
+
if (bd.indexOf(name) !== -1) return true
var pkg = this.tree.children.filter(nameMatch(name))[0]
if (!pkg) return false