From 9e1c9a215d94dd84d6b5cccbabcbc4e1b37bf36f Mon Sep 17 00:00:00 2001 From: Graeme Yeates Date: Sun, 19 Jun 2016 13:40:38 -0400 Subject: Build docs --- docs/file/lib/internal/applyEach.js.html | 131 ++++++++++++ docs/file/lib/internal/concat.js.html | 123 ++++++++++++ docs/file/lib/internal/consoleFunc.js.html | 133 ++++++++++++ docs/file/lib/internal/createTester.js.html | 152 ++++++++++++++ docs/file/lib/internal/doLimit.js.html | 117 +++++++++++ docs/file/lib/internal/doParallel.js.html | 119 +++++++++++ docs/file/lib/internal/doParallelLimit.js.html | 119 +++++++++++ docs/file/lib/internal/doSeries.js.html | 119 +++++++++++ docs/file/lib/internal/eachOfLimit.js.html | 160 +++++++++++++++ docs/file/lib/internal/filter.js.html | 140 +++++++++++++ docs/file/lib/internal/findGetResult.js.html | 115 +++++++++++ docs/file/lib/internal/getIterator.js.html | 117 +++++++++++ docs/file/lib/internal/initialParams.js.html | 120 +++++++++++ docs/file/lib/internal/iterator.js.html | 146 ++++++++++++++ docs/file/lib/internal/map.js.html | 131 ++++++++++++ docs/file/lib/internal/notId.js.html | 115 +++++++++++ docs/file/lib/internal/once.js.html | 120 +++++++++++ docs/file/lib/internal/onlyOnce.js.html | 120 +++++++++++ docs/file/lib/internal/parallel.js.html | 132 ++++++++++++ docs/file/lib/internal/queue.js.html | 267 +++++++++++++++++++++++++ docs/file/lib/internal/reject.js.html | 125 ++++++++++++ docs/file/lib/internal/setImmediate.js.html | 142 +++++++++++++ docs/file/lib/internal/withoutIndex.js.html | 117 +++++++++++ 23 files changed, 3080 insertions(+) create mode 100644 docs/file/lib/internal/applyEach.js.html create mode 100644 docs/file/lib/internal/concat.js.html create mode 100644 docs/file/lib/internal/consoleFunc.js.html create mode 100644 docs/file/lib/internal/createTester.js.html create mode 100644 docs/file/lib/internal/doLimit.js.html create mode 100644 docs/file/lib/internal/doParallel.js.html create mode 100644 docs/file/lib/internal/doParallelLimit.js.html create mode 100644 docs/file/lib/internal/doSeries.js.html create mode 100644 docs/file/lib/internal/eachOfLimit.js.html create mode 100644 docs/file/lib/internal/filter.js.html create mode 100644 docs/file/lib/internal/findGetResult.js.html create mode 100644 docs/file/lib/internal/getIterator.js.html create mode 100644 docs/file/lib/internal/initialParams.js.html create mode 100644 docs/file/lib/internal/iterator.js.html create mode 100644 docs/file/lib/internal/map.js.html create mode 100644 docs/file/lib/internal/notId.js.html create mode 100644 docs/file/lib/internal/once.js.html create mode 100644 docs/file/lib/internal/onlyOnce.js.html create mode 100644 docs/file/lib/internal/parallel.js.html create mode 100644 docs/file/lib/internal/queue.js.html create mode 100644 docs/file/lib/internal/reject.js.html create mode 100644 docs/file/lib/internal/setImmediate.js.html create mode 100644 docs/file/lib/internal/withoutIndex.js.html (limited to 'docs/file/lib/internal') diff --git a/docs/file/lib/internal/applyEach.js.html b/docs/file/lib/internal/applyEach.js.html new file mode 100644 index 0000000..2be8898 --- /dev/null +++ b/docs/file/lib/internal/applyEach.js.html @@ -0,0 +1,131 @@ + + + + + + lib/internal/applyEach.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/applyEach.js

+
import rest from 'lodash/rest';
+import initialParams from './initialParams';
+
+export default function applyEach(eachfn) {
+    return rest(function(fns, args) {
+        var go = initialParams(function(args, callback) {
+            var that = this;
+            return eachfn(fns, function (fn, cb) {
+                fn.apply(that, args.concat([cb]));
+            }, callback);
+        });
+        if (args.length) {
+            return go.apply(this, args);
+        }
+        else {
+            return go;
+        }
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/concat.js.html b/docs/file/lib/internal/concat.js.html new file mode 100644 index 0000000..ceeb654 --- /dev/null +++ b/docs/file/lib/internal/concat.js.html @@ -0,0 +1,123 @@ + + + + + + lib/internal/concat.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/concat.js

+
export default function concat(eachfn, arr, fn, callback) {
+    var result = [];
+    eachfn(arr, function (x, index, cb) {
+        fn(x, function (err, y) {
+            result = result.concat(y || []);
+            cb(err);
+        });
+    }, function (err) {
+        callback(err, result);
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/consoleFunc.js.html b/docs/file/lib/internal/consoleFunc.js.html new file mode 100644 index 0000000..90b090f --- /dev/null +++ b/docs/file/lib/internal/consoleFunc.js.html @@ -0,0 +1,133 @@ + + + + + + lib/internal/consoleFunc.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/consoleFunc.js

+
import arrayEach from 'lodash/_arrayEach';
+import rest from 'lodash/rest';
+
+export default function consoleFunc(name) {
+    return rest(function (fn, args) {
+        fn.apply(null, args.concat([rest(function (err, args) {
+            if (typeof console === 'object') {
+                if (err) {
+                    if (console.error) {
+                        console.error(err);
+                    }
+                }
+                else if (console[name]) {
+                    arrayEach(args, function (x) {
+                        console[name](x);
+                    });
+                }
+            }
+        })]));
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/createTester.js.html b/docs/file/lib/internal/createTester.js.html new file mode 100644 index 0000000..b82ee05 --- /dev/null +++ b/docs/file/lib/internal/createTester.js.html @@ -0,0 +1,152 @@ + + + + + + lib/internal/createTester.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/createTester.js

+
'use strict';
+import noop from 'lodash/noop';
+
+export default function _createTester(eachfn, check, getResult) {
+    return function(arr, limit, iteratee, cb) {
+        function done(err) {
+            if (cb) {
+                if (err) {
+                    cb(err);
+                } else {
+                    cb(null, getResult(false));
+                }
+            }
+        }
+        function wrappedIteratee(x, _, callback) {
+            if (!cb) return callback();
+            iteratee(x, function (err, v) {
+                if (cb) {
+                    if (err) {
+                        cb(err);
+                        cb = iteratee = false;
+                    } else if (check(v)) {
+                        cb(null, getResult(true, x));
+                        cb = iteratee = false;
+                    }
+                }
+                callback();
+            });
+        }
+        if (arguments.length > 3) {
+            cb = cb || noop;
+            eachfn(arr, limit, wrappedIteratee, done);
+        } else {
+            cb = iteratee;
+            cb = cb || noop;
+            iteratee = limit;
+            eachfn(arr, wrappedIteratee, done);
+        }
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/doLimit.js.html b/docs/file/lib/internal/doLimit.js.html new file mode 100644 index 0000000..985fb65 --- /dev/null +++ b/docs/file/lib/internal/doLimit.js.html @@ -0,0 +1,117 @@ + + + + + + lib/internal/doLimit.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/doLimit.js

+
export default function doLimit(fn, limit) {
+    return function (iterable, iteratee, callback) {
+        return fn(iterable, limit, iteratee, callback);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/doParallel.js.html b/docs/file/lib/internal/doParallel.js.html new file mode 100644 index 0000000..1147298 --- /dev/null +++ b/docs/file/lib/internal/doParallel.js.html @@ -0,0 +1,119 @@ + + + + + + lib/internal/doParallel.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/doParallel.js

+
import eachOf from '../eachOf';
+
+export default function doParallel(fn) {
+    return function (obj, iteratee, callback) {
+        return fn(eachOf, obj, iteratee, callback);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/doParallelLimit.js.html b/docs/file/lib/internal/doParallelLimit.js.html new file mode 100644 index 0000000..b125ff3 --- /dev/null +++ b/docs/file/lib/internal/doParallelLimit.js.html @@ -0,0 +1,119 @@ + + + + + + lib/internal/doParallelLimit.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/doParallelLimit.js

+
import eachOfLimit from './eachOfLimit';
+
+export default function doParallelLimit(fn) {
+    return function (obj, limit, iteratee, callback) {
+        return fn(eachOfLimit(limit), obj, iteratee, callback);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/doSeries.js.html b/docs/file/lib/internal/doSeries.js.html new file mode 100644 index 0000000..3de044d --- /dev/null +++ b/docs/file/lib/internal/doSeries.js.html @@ -0,0 +1,119 @@ + + + + + + lib/internal/doSeries.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/doSeries.js

+
import eachOfSeries from '../eachOfSeries';
+
+export default function doSeries(fn) {
+    return function (obj, iteratee, callback) {
+        return fn(eachOfSeries, obj, iteratee, callback);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/eachOfLimit.js.html b/docs/file/lib/internal/eachOfLimit.js.html new file mode 100644 index 0000000..e1b8124 --- /dev/null +++ b/docs/file/lib/internal/eachOfLimit.js.html @@ -0,0 +1,160 @@ + + + + + + lib/internal/eachOfLimit.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/eachOfLimit.js

+
import noop from 'lodash/noop';
+import once from './once';
+
+import iterator from './iterator';
+import onlyOnce from './onlyOnce';
+
+export default function _eachOfLimit(limit) {
+    return function (obj, iteratee, callback) {
+        callback = once(callback || noop);
+        obj = obj || [];
+        var nextElem = iterator(obj);
+        if (limit <= 0) {
+            return callback(null);
+        }
+        var done = false;
+        var running = 0;
+        var errored = false;
+
+        (function replenish () {
+            if (done && running <= 0) {
+                return callback(null);
+            }
+
+            while (running < limit && !errored) {
+                var elem = nextElem();
+                if (elem === null) {
+                    done = true;
+                    if (running <= 0) {
+                        callback(null);
+                    }
+                    return;
+                }
+                running += 1;
+                /* eslint {no-loop-func: 0} */
+                iteratee(elem.value, elem.key, onlyOnce(function (err) {
+                    running -= 1;
+                    if (err) {
+                        callback(err);
+                        errored = true;
+                    }
+                    else {
+                        replenish();
+                    }
+                }));
+            }
+        })();
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/filter.js.html b/docs/file/lib/internal/filter.js.html new file mode 100644 index 0000000..f891536 --- /dev/null +++ b/docs/file/lib/internal/filter.js.html @@ -0,0 +1,140 @@ + + + + + + lib/internal/filter.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/filter.js

+
import arrayMap from 'lodash/_arrayMap';
+import property from 'lodash/_baseProperty';
+
+export default function _filter(eachfn, arr, iteratee, callback) {
+    var results = [];
+    eachfn(arr, function (x, index, callback) {
+        iteratee(x, function (err, v) {
+            if (err) {
+                callback(err);
+            }
+            else {
+                if (v) {
+                    results.push({index: index, value: x});
+                }
+                callback();
+            }
+        });
+    }, function (err) {
+        if (err) {
+            callback(err);
+        }
+        else {
+            callback(null, arrayMap(results.sort(function (a, b) {
+                return a.index - b.index;
+            }), property('value')));
+        }
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/findGetResult.js.html b/docs/file/lib/internal/findGetResult.js.html new file mode 100644 index 0000000..f548421 --- /dev/null +++ b/docs/file/lib/internal/findGetResult.js.html @@ -0,0 +1,115 @@ + + + + + + lib/internal/findGetResult.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/findGetResult.js

+
export default function _findGetResult(v, x) {
+    return x;
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/getIterator.js.html b/docs/file/lib/internal/getIterator.js.html new file mode 100644 index 0000000..39f5e7d --- /dev/null +++ b/docs/file/lib/internal/getIterator.js.html @@ -0,0 +1,117 @@ + + + + + + lib/internal/getIterator.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/getIterator.js

+
var iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;
+
+export default function (coll) {
+    return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/initialParams.js.html b/docs/file/lib/internal/initialParams.js.html new file mode 100644 index 0000000..a2bdffd --- /dev/null +++ b/docs/file/lib/internal/initialParams.js.html @@ -0,0 +1,120 @@ + + + + + + lib/internal/initialParams.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/initialParams.js

+
import rest from 'lodash/rest';
+
+export default function (fn) {
+    return rest(function (args/*..., callback*/) {
+        var callback = args.pop();
+        fn.call(this, args, callback);
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/iterator.js.html b/docs/file/lib/internal/iterator.js.html new file mode 100644 index 0000000..b582d8f --- /dev/null +++ b/docs/file/lib/internal/iterator.js.html @@ -0,0 +1,146 @@ + + + + + + lib/internal/iterator.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/iterator.js

+
import isArrayLike from 'lodash/isArrayLike';
+import getIterator from './getIterator';
+import keys from 'lodash/keys';
+
+export default function iterator(coll) {
+    var i = -1;
+    var len;
+    if (isArrayLike(coll)) {
+        len = coll.length;
+        return function next() {
+            i++;
+            return i < len ? {value: coll[i], key: i} : null;
+        };
+    }
+
+    var iterate = getIterator(coll);
+    if (iterate) {
+        return function next() {
+            var item = iterate.next();
+            if (item.done)
+                return null;
+            i++;
+            return {value: item.value, key: i};
+        };
+    }
+
+    var okeys = keys(coll);
+    len = okeys.length;
+    return function next() {
+        i++;
+        var key = okeys[i];
+        return i < len ? {value: coll[key], key: key} : null;
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/map.js.html b/docs/file/lib/internal/map.js.html new file mode 100644 index 0000000..22fe569 --- /dev/null +++ b/docs/file/lib/internal/map.js.html @@ -0,0 +1,131 @@ + + + + + + lib/internal/map.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/map.js

+
import noop from 'lodash/noop';
+import once from './once';
+
+export default function _asyncMap(eachfn, arr, iteratee, callback) {
+    callback = once(callback || noop);
+    arr = arr || [];
+    var results = [];
+    var counter = 0;
+
+    eachfn(arr, function (value, _, callback) {
+        var index = counter++;
+        iteratee(value, function (err, v) {
+            results[index] = v;
+            callback(err);
+        });
+    }, function (err) {
+        callback(err, results);
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/notId.js.html b/docs/file/lib/internal/notId.js.html new file mode 100644 index 0000000..052f270 --- /dev/null +++ b/docs/file/lib/internal/notId.js.html @@ -0,0 +1,115 @@ + + + + + + lib/internal/notId.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/notId.js

+
export default function notId(v) {
+    return !v;
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/once.js.html b/docs/file/lib/internal/once.js.html new file mode 100644 index 0000000..62a40dd --- /dev/null +++ b/docs/file/lib/internal/once.js.html @@ -0,0 +1,120 @@ + + + + + + lib/internal/once.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/once.js

+
export default function once(fn) {
+    return function () {
+        if (fn === null) return;
+        var callFn = fn;
+        fn = null;
+        callFn.apply(this, arguments);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/onlyOnce.js.html b/docs/file/lib/internal/onlyOnce.js.html new file mode 100644 index 0000000..65f1325 --- /dev/null +++ b/docs/file/lib/internal/onlyOnce.js.html @@ -0,0 +1,120 @@ + + + + + + lib/internal/onlyOnce.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/onlyOnce.js

+
export default function onlyOnce(fn) {
+    return function() {
+        if (fn === null) throw new Error("Callback was already called.");
+        var callFn = fn;
+        fn = null;
+        callFn.apply(this, arguments);
+    };
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/parallel.js.html b/docs/file/lib/internal/parallel.js.html new file mode 100644 index 0000000..64f4e3e --- /dev/null +++ b/docs/file/lib/internal/parallel.js.html @@ -0,0 +1,132 @@ + + + + + + lib/internal/parallel.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/parallel.js

+
import noop from 'lodash/noop';
+import isArrayLike from 'lodash/isArrayLike';
+import rest from 'lodash/rest';
+
+export default function _parallel(eachfn, tasks, callback) {
+    callback = callback || noop;
+    var results = isArrayLike(tasks) ? [] : {};
+
+    eachfn(tasks, function (task, key, callback) {
+        task(rest(function (err, args) {
+            if (args.length <= 1) {
+                args = args[0];
+            }
+            results[key] = args;
+            callback(err);
+        }));
+    }, function (err) {
+        callback(err, results);
+    });
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/queue.js.html b/docs/file/lib/internal/queue.js.html new file mode 100644 index 0000000..72703e8 --- /dev/null +++ b/docs/file/lib/internal/queue.js.html @@ -0,0 +1,267 @@ + + + + + + lib/internal/queue.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/queue.js

+
import arrayEach from 'lodash/_arrayEach';
+import arrayMap from 'lodash/_arrayMap';
+import isArray from 'lodash/isArray';
+import noop from 'lodash/noop';
+import property from 'lodash/_baseProperty';
+
+import onlyOnce from './onlyOnce';
+import setImmediate from './setImmediate';
+
+export default function queue(worker, concurrency, payload) {
+    if (concurrency == null) {
+        concurrency = 1;
+    }
+    else if(concurrency === 0) {
+        throw new Error('Concurrency must not be zero');
+    }
+    function _insert(q, data, pos, callback) {
+        if (callback != null && typeof callback !== 'function') {
+            throw new Error('task callback must be a function');
+        }
+        q.started = true;
+        if (!isArray(data)) {
+            data = [data];
+        }
+        if(data.length === 0 && q.idle()) {
+            // call drain immediately if there are no tasks
+            return setImmediate(function() {
+                q.drain();
+            });
+        }
+        arrayEach(data, function(task) {
+            var item = {
+                data: task,
+                callback: callback || noop
+            };
+
+            if (pos) {
+                q.tasks.unshift(item);
+            } else {
+                q.tasks.push(item);
+            }
+
+        });
+        setImmediate(q.process);
+    }
+    function _next(q, tasks) {
+        return function(){
+            workers -= 1;
+
+
+            var removed = false;
+            var args = arguments;
+            arrayEach(tasks, function (task) {
+                arrayEach(workersList, function (worker, index) {
+                    if (worker === task && !removed) {
+                        workersList.splice(index, 1);
+                        removed = true;
+                    }
+                });
+
+                task.callback.apply(task, args);
+
+                if (args[0] != null) {
+                    q.error(args[0], task.data);
+                }
+            });
+
+            if (workers <= (q.concurrency - q.buffer) ) {
+                q.unsaturated();
+            }
+
+            if (q.tasks.length + workers === 0) {
+                q.drain();
+            }
+            q.process();
+        };
+    }
+
+    var workers = 0;
+    var workersList = [];
+    var q = {
+        tasks: [],
+        concurrency: concurrency,
+        payload: payload,
+        saturated: noop,
+        unsaturated:noop,
+        buffer: concurrency / 4,
+        empty: noop,
+        drain: noop,
+        error: noop,
+        started: false,
+        paused: false,
+        push: function (data, callback) {
+            _insert(q, data, false, callback);
+        },
+        kill: function () {
+            q.drain = noop;
+            q.tasks = [];
+        },
+        unshift: function (data, callback) {
+            _insert(q, data, true, callback);
+        },
+        process: function () {
+            while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+                var tasks = q.payload ?
+                    q.tasks.splice(0, q.payload) :
+                    q.tasks.splice(0, q.tasks.length);
+
+                var data = arrayMap(tasks, property('data'));
+
+                if (q.tasks.length === 0) {
+                    q.empty();
+                }
+                workers += 1;
+                workersList.push(tasks[0]);
+
+                if (workers === q.concurrency) {
+                    q.saturated();
+                }
+
+                var cb = onlyOnce(_next(q, tasks));
+                worker(data, cb);
+
+
+            }
+        },
+        length: function () {
+            return q.tasks.length;
+        },
+        running: function () {
+            return workers;
+        },
+        workersList: function () {
+            return workersList;
+        },
+        idle: function() {
+            return q.tasks.length + workers === 0;
+        },
+        pause: function () {
+            q.paused = true;
+        },
+        resume: function () {
+            if (q.paused === false) { return; }
+            q.paused = false;
+            var resumeCount = Math.min(q.concurrency, q.tasks.length);
+            // Need to call q.process once per concurrent
+            // worker to preserve full concurrency after pause
+            for (var w = 1; w <= resumeCount; w++) {
+                setImmediate(q.process);
+            }
+        }
+    };
+    return q;
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/reject.js.html b/docs/file/lib/internal/reject.js.html new file mode 100644 index 0000000..1065ee8 --- /dev/null +++ b/docs/file/lib/internal/reject.js.html @@ -0,0 +1,125 @@ + + + + + + lib/internal/reject.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/reject.js

+
import filter from './filter';
+
+export default function reject(eachfn, arr, iteratee, callback) {
+    filter(eachfn, arr, function(value, cb) {
+        iteratee(value, function(err, v) {
+            if (err) {
+                cb(err);
+            } else {
+                cb(null, !v);
+            }
+        });
+    }, callback);
+}
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/setImmediate.js.html b/docs/file/lib/internal/setImmediate.js.html new file mode 100644 index 0000000..aca6083 --- /dev/null +++ b/docs/file/lib/internal/setImmediate.js.html @@ -0,0 +1,142 @@ + + + + + + lib/internal/setImmediate.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/setImmediate.js

+
'use strict';
+
+import rest from 'lodash/rest';
+
+export var hasSetImmediate = typeof setImmediate === 'function' && setImmediate;
+export var hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';
+
+export function fallback(fn) {
+    setTimeout(fn, 0);
+}
+
+export function wrap(defer) {
+    return rest(function (fn, args) {
+        defer(function () {
+            fn.apply(null, args);
+        });
+    });
+}
+
+var _defer;
+
+if (hasSetImmediate) {
+    _defer = setImmediate;
+} else if (hasNextTick) {
+    _defer = process.nextTick;
+} else {
+    _defer = fallback;
+}
+
+export default wrap(_defer);
+
+ +
+ + + + + + + + + + + + diff --git a/docs/file/lib/internal/withoutIndex.js.html b/docs/file/lib/internal/withoutIndex.js.html new file mode 100644 index 0000000..84789bf --- /dev/null +++ b/docs/file/lib/internal/withoutIndex.js.html @@ -0,0 +1,117 @@ + + + + + + lib/internal/withoutIndex.js | API Document + + + + + + + + + +
+ Home + + Reference + Source + + Repository + +
+ + + +

lib/internal/withoutIndex.js

+
export default function _withoutIndex(iteratee) {
+    return function (value, index, callback) {
+        return iteratee(value, callback);
+    };
+}
+
+ +
+ + + + + + + + + + + + -- cgit v1.2.1