diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/async-foreach/lib | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/async-foreach/lib')
-rw-r--r-- | node_modules/async-foreach/lib/foreach.js | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/node_modules/async-foreach/lib/foreach.js b/node_modules/async-foreach/lib/foreach.js deleted file mode 100644 index 9ee98b0..0000000 --- a/node_modules/async-foreach/lib/foreach.js +++ /dev/null @@ -1,63 +0,0 @@ -/*! - * Sync/Async forEach - * https://github.com/cowboy/javascript-sync-async-foreach - * - * Copyright (c) 2012 "Cowboy" Ben Alman - * Licensed under the MIT license. - * http://benalman.com/about/license/ - */ - -(function(exports) { - - // Iterate synchronously or asynchronously. - exports.forEach = function(arr, eachFn, doneFn) { - var i = -1; - // Resolve array length to a valid (ToUint32) number. - var len = arr.length >>> 0; - - // This IIFE is called once now, and then again, by name, for each loop - // iteration. - (function next(result) { - // This flag will be set to true if `this.async` is called inside the - // eachFn` callback. - var async; - // Was false returned from the `eachFn` callback or passed to the - // `this.async` done function? - var abort = result === false; - - // Increment counter variable and skip any indices that don't exist. This - // allows sparse arrays to be iterated. - do { ++i; } while (!(i in arr) && i !== len); - - // Exit if result passed to `this.async` done function or returned from - // the `eachFn` callback was false, or when done iterating. - if (abort || i === len) { - // If a `doneFn` callback was specified, invoke that now. Pass in a - // boolean value representing "not aborted" state along with the array. - if (doneFn) { - doneFn(!abort, arr); - } - return; - } - - // Invoke the `eachFn` callback, setting `this` inside the callback to a - // custom object that contains one method, and passing in the array item, - // index, and the array. - result = eachFn.call({ - // If `this.async` is called inside the `eachFn` callback, set the async - // flag and return a function that can be used to continue iterating. - async: function() { - async = true; - return next; - } - }, arr[i], i, arr); - - // If the async flag wasn't set, continue by calling `next` synchronously, - // passing in the result of the `eachFn` callback. - if (!async) { - next(result); - } - }()); - }; - -}(typeof exports === "object" && exports || this));
\ No newline at end of file |