Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix error if command called with args array and cb

  • Loading branch information...
commit 27b7147a82f071ff5cd1870f107b449f14e22354 1 parent be298fc
@mintplant authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/npm.js
View
8 lib/npm.js
@@ -464,14 +464,14 @@ Object.getOwnPropertyNames(npm.commands).forEach(function (n) {
var args = Array.prototype.slice.call(arguments, 0)
, cb = defaultCb
- if (args.length === 1 && Array.isArray(args[0])) {
- args = args[0]
- }
-
if (typeof args[args.length - 1] === "function") {
cb = args.pop()
}
+ if (args.length === 1 && Array.isArray(args[0])) {
+ args = args[0]
+ }
+
npm.commands[n](args, cb)
}
}, enumerable: false, configurable: true })
Please sign in to comment.
Something went wrong with that request. Please try again.