+24
-33
| (function() { | ||
| var fa; | ||
| fa = function(concurrency, do_all, with_index) { | ||
| var api, nullFn, tmpl; | ||
| if (concurrency == null) { | ||
| concurrency = Number.MAX_VALUE; | ||
| if (concurrency == null) concurrency = Number.MAX_VALUE; | ||
| if (do_all == null) do_all = false; | ||
| if (with_index == null) with_index = false; | ||
| if (typeof process === "undefined" || process === null) process = {}; | ||
| if (process.nextTick == null) { | ||
| process.nextTick = function(cb) { | ||
| return cb(); | ||
| }; | ||
| } | ||
| if (do_all == null) { | ||
| do_all = false; | ||
| } | ||
| if (with_index == null) { | ||
| with_index = false; | ||
| } | ||
| api = {}; | ||
@@ -23,8 +24,4 @@ api.reduce = function(arr, memo, iterator, callback) { | ||
| } | ||
| if (!keys.length) { | ||
| return callback(void 0, memo); | ||
| } | ||
| if (do_all) { | ||
| errs = []; | ||
| } | ||
| if (!keys.length) return callback(void 0, memo); | ||
| if (do_all) errs = []; | ||
| size = pending = keys.length; | ||
@@ -71,5 +68,3 @@ count = 0; | ||
| var count, errs, finished, i, isArray, keys, nextItem, pending, results, size, theCallback, workers, _ref, _results; | ||
| if (what == null) { | ||
| what = 0; | ||
| } | ||
| if (what == null) what = 0; | ||
| isArray = Array.isArray(arr); | ||
@@ -85,5 +80,3 @@ keys = isArray ? arr : Object.keys(arr); | ||
| } | ||
| if (do_all) { | ||
| errs = []; | ||
| } | ||
| if (do_all) errs = []; | ||
| workers = 0; | ||
@@ -177,5 +170,3 @@ size = pending = keys.length; | ||
| }), true, function(results, result, val) { | ||
| if (result) { | ||
| results.push(val); | ||
| } | ||
| if (result) results.push(val); | ||
| return results; | ||
@@ -186,5 +177,3 @@ }); | ||
| }), true, function(results, result, val) { | ||
| if (!result) { | ||
| results.push(val); | ||
| } | ||
| if (!result) results.push(val); | ||
| return results; | ||
@@ -195,5 +184,3 @@ }); | ||
| }), true, function(results, result, val, index, callback) { | ||
| if (results === void 0) { | ||
| results = 0; | ||
| } | ||
| if (results === void 0) results = 0; | ||
| if (result) { | ||
@@ -218,5 +205,3 @@ callback(val, results); | ||
| }), true, (function(results, result, val, index, callback) { | ||
| if (results === true) { | ||
| results = 0; | ||
| } | ||
| if (results === true) results = 0; | ||
| if (result) { | ||
@@ -268,3 +253,9 @@ return ++results; | ||
| }; | ||
| module.exports = fa(); | ||
| if (typeof module !== 'undefined') { | ||
| module.exports = fa(); | ||
| } else { | ||
| window.fa = fa(); | ||
| } | ||
| }).call(this); |
+3
-1
| { "name": "fa" | ||
| , "description": "fluent async: functional programming support for asynchronous functions." | ||
| , "version": "0.1.1" | ||
| , "keywords": ["flow-control", "controlflow", "async", "functional"] | ||
| , "version": "1.0.0" | ||
| , "main": "./lib/fa.js" | ||
@@ -10,2 +11,3 @@ , "dependencies": {} | ||
| , "homepage": "https://github.com/wvl/fa" | ||
| , "bugs": { "url": "https://github.com/wvl/fa/issues" } | ||
| , "repository": | ||
@@ -12,0 +14,0 @@ { "type": "git" |
+8
-1
| fa = (concurrency=Number.MAX_VALUE, do_all=false, with_index=false) -> | ||
| process ?= {} | ||
| process.nextTick ?= (cb) -> | ||
| cb() | ||
| api = {} | ||
@@ -212,2 +216,5 @@ | ||
| module.exports = fa() | ||
| if typeof(module) != 'undefined' | ||
| module.exports = fa() | ||
| else | ||
| window.fa = fa() |
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
29483
1.07%1
-50%0
-100%249
-4.6%