From 9e030f7426958c8df7f292acc823d97d979916fd Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 18 Jun 2015 11:32:59 -0400 Subject: publish: Throw an error if the bundled deps package.json entry is invalid --- lib/utils/tar.js | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.3