Skip to content

Commit

Permalink
publish: Throw an error if the bundled deps package.json entry is inv…
Browse files Browse the repository at this point in the history
…alid
  • Loading branch information
iarna committed Jun 26, 2015
1 parent f10ed2f commit 9e030f7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/utils/tar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e030f7

Please sign in to comment.