in-parallel
Advanced tools
Comparing version 0.4.0 to 0.6.0
13
index.js
function isFunction(functionToCheck) { | ||
var getType = {}; | ||
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; | ||
var getType = {}; | ||
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; | ||
} | ||
@@ -10,3 +11,3 @@ | ||
if(prefs) { | ||
if(prefs.showDebugMessages) showDebugMessages = prefs.showDebudMessages; | ||
if(prefs.showDebugMessages) showDebugMessages = !!prefs.showDebudMessages; | ||
} | ||
@@ -17,3 +18,3 @@ }, | ||
if(collection.length > 0) { | ||
if(showDebugMessages) console.log("Running actions in parallel."); | ||
if(this.showDebugMessages) console.log("Running actions in parallel."); | ||
collection.parallelErrorsMap99 = {}; | ||
@@ -44,3 +45,3 @@ var numElements = collection.length; | ||
} else { | ||
if(showDebugMessages) { | ||
if(this.showDebugMessages) { | ||
console.log("Provided collection is empty."); | ||
@@ -57,3 +58,3 @@ } | ||
} else { | ||
if(showDebugMessages) console.log("Missing necessary arguments. No collection provided."); | ||
if(this.showDebugMessages) console.log("Missing necessary arguments. No collection provided."); | ||
if(isFunction(handleError)) handleError({message:"Missing necessary arguments: " + collection + " " + parallelAction + " " + onFinish}); | ||
@@ -60,0 +61,0 @@ } |
{ | ||
"name": "in-parallel", | ||
"version": "0.4.0", | ||
"version": "0.6.0", | ||
"description": "A small library for Runs a function on the elements of the provided collection in parallel ", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5438