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:
authorisaacs <i@izs.me>2010-08-25 06:29:32 +0400
committerisaacs <i@izs.me>2010-08-25 16:21:51 +0400
commit6abef2e2956fde7ba8056706cfbe43b9b6e3abd6 (patch)
tree221dab8e9bbe491054598ecd9689a64acdf31981
parentf6d2609b82f1ed9f921d45cc3cdee23b7b52a564 (diff)
Throw if no cb provided, since that's an annoying error to track down.
-rw-r--r--lib/utils/async-map.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/utils/async-map.js b/lib/utils/async-map.js
index 0776c9be9..1efaeac81 100644
--- a/lib/utils/async-map.js
+++ b/lib/utils/async-map.js
@@ -11,6 +11,8 @@ module.exports = asyncMap
function asyncMap (list, fn, n, cb_) {
if (typeof n === "function") cb_ = n, n = 1
+ if (typeof cb_ !== "function") throw new Error(
+ "No callback provided to asyncMap")
if (!list || !list.length) return cb_(null, [])
var data = []
, errState = null