package/LICENSE000644 0000002104 3560116604 010262 0ustar00000000 000000 MIT License Copyright (c) 2016 Paul Miller (https://paulmillr.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. package/index.js000644 0000002525 3560116604 010731 0ustar00000000 000000 /*! async-each - MIT License (c) 2016 Paul Miller (paulmillr.com) */ (function (globals) { 'use strict'; var each = function (items, next, callback) { if (!Array.isArray(items)) throw new TypeError('each() expects array as first argument'); if (typeof next !== 'function') throw new TypeError('each() expects function as second argument'); if (typeof callback !== 'function') callback = Function.prototype; // no-op var total = items.length; if (total === 0) return callback(undefined, items); var transformed = new Array(total); var transformedCount = 0; var returned = false; items.forEach(function (item, index) { next(item, function (error, transformedItem) { if (returned) return; if (error) { returned = true; return callback(error); } transformed[index] = transformedItem; transformedCount += 1; // can't use index: last item could take more time if (transformedCount === total) return callback(undefined, transformed); }); }); }; if (typeof define !== 'undefined' && define.amd) { define([], function () { return each; }); // RequireJS } else if (typeof module !== 'undefined' && module.exports) { module.exports = each; // CommonJS } else { globals.asyncEach = each; //