New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@async-af/foreach

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@async-af/foreach - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

63

esm/index.js
/*!
* @async-af/foreach/esm v6.0.0
* @async-af/foreach/esm v7.0.0
*
* AsyncAF (Async/Await Fun) forEachAF method
* AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?) forEachAF method
* (https://async-af.js.org/AsyncAF#forEachAF)

@@ -18,2 +18,45 @@ *

var promiseAllWithHoles = function promiseAllWithHoles(promises) {
return new Promise(function (resolve, reject) {
var length = promises.length >>> 0;
var result = Array(length);
var pending = length;
var i = length;
if (!length) return resolve(result);
var settlePromise = function settlePromise(i) {
return Promise.resolve(promises[i]).then(function (value) {
if (i in promises) result[i] = value;
if (! --pending) resolve(result);
}, reject);
};
while (i--) {
settlePromise(i);
}
});
};
var serial = function serial(arr) {
return function resolveSerially(resolved, i) {
var length = resolved.length;
if (!length) return Promise.resolve(resolved);
var hole = !(i in arr);
return Promise.resolve(arr[i]).then(function (el) {
if (!hole) resolved[i] = el;
if (i === length - 1) return resolved;
return resolveSerially(resolved, i + 1);
});
}(Array(arr.length >>> 0), 0);
};
var parallel = function parallel(arr, mapper) {
var thisArg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
return promiseAllWithHoles(arr, function (el) {
return el;
}).then(!mapper ? undefined : function (arr) {
return promiseAllWithHoles(Array.prototype.map.call(arr, mapper, thisArg));
});
};
/**

@@ -24,2 +67,4 @@ * executes a callback function on each element in an array

*
* *Note*: if you'd rather resolve and process elements in series, consider using `series.forEachAF` or its alias, `io.forEachAF`
*
* @param {callback} callback function to execute for each element

@@ -42,3 +87,4 @@ *

* @since 3.0.0
* @see forEach
* @see forEach (alias)
* @see {@link AsyncAF#series series.forEachAF}
* @memberof AsyncAF#

@@ -48,6 +94,15 @@ */

var forEachAF = function forEachAF(callback$$1) {
var _this = this;
var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
return this.then(function (arr) {
if (!permissiveIsArrayLike(arr)) throw TypeError("forEachAF cannot be called on ".concat(arr, ", only on an Array or array-like Object"));
return Array.prototype.forEach.call(arr, callback$$1, thisArg);
if (typeof callback$$1 !== 'function') throw TypeError("".concat(callback$$1, " is not a function"));
return (_this.inSeries ? serial(arr).then(function (arr) {
return arr.reduce(function (expr, el, i, arr) {
return expr.then(function () {
return Promise.resolve(callback$$1.call(thisArg, el, i, arr));
});
}, Promise.resolve());
}) : parallel(arr, callback$$1, thisArg)).then(function () {});
});

@@ -54,0 +109,0 @@ };

6

esm/min.js
/*!
* @async-af/foreach/esm/min v6.0.0
* @async-af/foreach/esm/min v7.0.0
*
* AsyncAF (Async/Await Fun) forEachAF method
* AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?) forEachAF method
* (https://async-af.js.org/AsyncAF#forEachAF)

@@ -12,3 +12,3 @@ *

*/
export default function(r){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.then(n=>{if(!(Array.isArray(o=n)||null!=o&&null!=o.length))throw TypeError("forEachAF cannot be called on ".concat(n,", only on an Array or array-like Object"));var o;return Array.prototype.forEach.call(n,r,a)})};
var r=r=>new Promise((e,n)=>{var o=r.length>>>0,t=Array(o),i=o,a=o;if(!o)return e(t);for(var l=o=>Promise.resolve(r[o]).then(n=>{o in r&&(t[o]=n),--i||e(t)},n);a--;)l(a)});export default function(e){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.then(t=>{if(!(Array.isArray(i=t)||null!=i&&null!=i.length))throw TypeError("forEachAF cannot be called on ".concat(t,", only on an Array or array-like Object"));var i;if("function"!=typeof e)throw TypeError("".concat(e," is not a function"));return(n.inSeries?(r=>(function e(n,o){var t=n.length;if(!t)return Promise.resolve(n);var i=!(o in r);return Promise.resolve(r[o]).then(r=>(i||(n[o]=r),o===t-1?n:e(n,o+1)))})(Array(r.length>>>0),0))(t).then(r=>r.reduce((r,n,t,i)=>r.then(()=>Promise.resolve(e.call(o,n,t,i))),Promise.resolve())):function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return r(e).then(n?e=>r(Array.prototype.map.call(e,n,o)):void 0)}(t,e,o)).then(()=>{})})};
//# sourceMappingURL=min.js.map
/*!
* @async-af/foreach v6.0.0
* @async-af/foreach v7.0.0
*
* AsyncAF (Async/Await Fun) forEachAF method
* AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?) forEachAF method
* (https://async-af.js.org/AsyncAF#forEachAF)

@@ -60,7 +60,3 @@ *

/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }

@@ -71,5 +67,24 @@ /******/ };

/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules

@@ -109,2 +124,3 @@ /******/ __webpack_require__.n = function(module) {

* @param {[]=} array
* @returns {any}
*/

@@ -130,2 +146,53 @@ function callback(currentValue, index, array) {}

/***/ "./lib/methods/_internal/promiseAllWithHoles.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
const promiseAllWithHoles = promises => new Promise((resolve, reject) => {
const length = promises.length >>> 0;
const result = Array(length);
let pending = length;
let i = length;
if (!length) return resolve(result);
const settlePromise = i => Promise.resolve(promises[i]).then(value => {
if (i in promises) result[i] = value;
if (! --pending) resolve(result);
}, reject);
while (i--) settlePromise(i);
});
/* harmony default export */ __webpack_exports__["default"] = (promiseAllWithHoles);
/***/ }),
/***/ "./lib/methods/_internal/resolve.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "serial", function() { return serial; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parallel", function() { return parallel; });
/* harmony import */ var _promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./lib/methods/_internal/promiseAllWithHoles.js");
const serial = arr => function resolveSerially(resolved, i) {
const length = resolved.length;
if (!length) return Promise.resolve(resolved);
const hole = !(i in arr);
return Promise.resolve(arr[i]).then(el => {
if (!hole) resolved[i] = el;
if (i === length - 1) return resolved;
return resolveSerially(resolved, i + 1);
});
}(Array(arr.length >>> 0), 0);
const parallel = (arr, mapper, thisArg = undefined) => Object(_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(arr, el => el).then(!mapper ? undefined : arr => Object(_promiseAllWithHoles__WEBPACK_IMPORTED_MODULE_0__["default"])(Array.prototype.map.call(arr, mapper, thisArg)));
/***/ }),
/***/ "./lib/methods/arrays/forEachAF.js":

@@ -138,5 +205,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

/* harmony import */ var _internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/methods/_internal/permissiveIsArrayLike.js");
/* harmony import */ var _internal_resolve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/methods/_internal/resolve.js");
// eslint-disable-line no-unused-vars
/**

@@ -147,2 +216,4 @@ * executes a callback function on each element in an array

*
* *Note*: if you'd rather resolve and process elements in series, consider using `series.forEachAF` or its alias, `io.forEachAF`
*
* @param {callback} callback function to execute for each element

@@ -165,3 +236,4 @@ *

* @since 3.0.0
* @see forEach
* @see forEach (alias)
* @see {@link AsyncAF#series series.forEachAF}
* @memberof AsyncAF#

@@ -173,3 +245,4 @@ */

if (!Object(_internal_permissiveIsArrayLike__WEBPACK_IMPORTED_MODULE_1__["default"])(arr)) throw TypeError(`forEachAF cannot be called on ${arr}, only on an Array or array-like Object`);
return Array.prototype.forEach.call(arr, callback, thisArg);
if (typeof callback !== 'function') throw TypeError(`${callback} is not a function`);
return (this.inSeries ? Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["serial"])(arr).then(arr => arr.reduce((expr, el, i, arr) => expr.then(() => Promise.resolve(callback.call(thisArg, el, i, arr))), Promise.resolve())) : Object(_internal_resolve__WEBPACK_IMPORTED_MODULE_2__["parallel"])(arr, callback, thisArg)).then(() => {});
});

@@ -176,0 +249,0 @@ };

/*!
* @async-af/foreach/legacy/min v6.0.0
* @async-af/foreach/legacy/min v7.0.0
*
* AsyncAF (Async/Await Fun) forEachAF method
* AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?) forEachAF method
* (https://async-af.js.org/AsyncAF#forEachAF)

@@ -12,3 +12,3 @@ *

*/
var e,r;e="undefined"!=typeof self?self:this,r=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=172)}({172:function(e,r,t){"use strict";t.r(r);var n=t(6);r.default=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.then(function(t){if(!Object(n.a)(t))throw TypeError("forEachAF cannot be called on ".concat(t,", only on an Array or array-like Object"));return Array.prototype.forEach.call(t,e,r)})}},6:function(e,r,t){"use strict";r.a=function(e){return Array.isArray(e)||null!=e&&null!=e.length}}}).default},"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("forEachAF",[],r):"object"==typeof exports?exports.forEachAF=r():e.forEachAF=r();
var t,n;t="undefined"!=typeof self?self:this,n=function(){return function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=119)}([function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(30)("wks"),o=r(28),i=r(0).Symbol,c="function"==typeof i;(t.exports=function(t){return e[t]||(e[t]=c&&i[t]||(c?i:o)("Symbol."+t))}).store=e},function(t,n,r){t.exports=r(67)},function(t,n){var r=t.exports={version:"2.5.5"};"number"==typeof __e&&(__e=r)},function(t,n,r){var e=r(5);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(10),o=r(25);t.exports=r(8)?function(t,n,r){return e.f(t,n,o(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(0),o=r(3),i=r(11),c=r(6),u=r(12),f=function(t,n,r){var s,a,l,p=t&f.F,v=t&f.G,h=t&f.S,d=t&f.P,y=t&f.B,m=t&f.W,x=v?o:o[n]||(o[n]={}),_=x.prototype,g=v?e:h?e[n]:(e[n]||{}).prototype;for(s in v&&(r=n),r)(a=!p&&g&&void 0!==g[s])&&u(x,s)||(l=a?g[s]:r[s],x[s]=v&&"function"!=typeof g[s]?r[s]:y&&a?i(l,e):m&&g[s]==l?function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n.prototype=t.prototype,n}(l):d&&"function"==typeof l?i(Function.call,l):l,d&&((x.virtual||(x.virtual={}))[s]=l,t&f.R&&_&&!_[s]&&c(_,s,l)))};f.F=1,f.G=2,f.S=4,f.P=8,f.B=16,f.W=32,f.U=64,f.R=128,t.exports=f},function(t,n,r){t.exports=!r(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){t.exports={}},function(t,n,r){var e=r(4),o=r(56),i=r(46),c=Object.defineProperty;n.f=r(8)?Object.defineProperty:function(t,n,r){if(e(t),n=i(n,!0),e(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(13);t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(47),o=r(20);t.exports=function(t){return e(o(t))}},function(t,n,r){"use strict";r.d(n,"b",function(){return c}),r.d(n,"a",function(){return u});var e=r(2),o=r.n(e),i=r(26),c=function(t){return function n(r,e){var i=r.length;if(!i)return o.a.resolve(r);var c=!(e in t);return o.a.resolve(t[e]).then(function(t){return c||(r[e]=t),e===i-1?r:n(r,e+1)})}(Array(t.length>>>0),0)},u=function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return Object(i.a)(t,function(t){return t}).then(n?function(t){return Object(i.a)(Array.prototype.map.call(t,n,r))}:void 0)}},function(t,n,r){var e=r(10).f,o=r(12),i=r(1)("toStringTag");t.exports=function(t,n,r){t&&!o(t=r?t:t.prototype,i)&&e(t,i,{configurable:!0,value:n})}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,r){var e=r(5),o=r(0).document,i=e(o)&&e(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(30)("keys"),o=r(28);t.exports=function(t){return e[t]||(e[t]=o(t))}},function(t,n,r){"use strict";var e=r(13);t.exports.f=function(t){return new function(t){var n,r;this.promise=new t(function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e}),this.resolve=e(n),this.reject=e(r)}(t)}},function(t,n,r){"use strict";n.a=function(t){return Array.isArray(t)||null!=t&&null!=t.length}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){"use strict";var e=r(2),o=r.n(e);n.a=function(t){return new o.a(function(n,r){var e=t.length>>>0,i=Array(e),c=e,u=e;if(!e)return n(i);for(var f=function(e){return o.a.resolve(t[e]).then(function(r){e in t&&(i[e]=r),--c||n(i)},r)};u--;)f(u)})}},function(t,n,r){var e=r(21),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n){t.exports=!0},function(t,n,r){var e=r(0),o=e["__core-js_shared__"]||(e["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(14),o=r(1)("toStringTag"),i="Arguments"==e(function(){return arguments}());t.exports=function(t){var n,r,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?r:i?e(n):"Object"==(c=e(n))&&"function"==typeof n.callee?"Arguments":c}},function(t,n,r){"use strict";var e=r(29),o=r(7),i=r(48),c=r(6),u=r(9),f=r(65),s=r(17),a=r(58),l=r(1)("iterator"),p=!([].keys&&"next"in[].keys()),v=function(){return this};t.exports=function(t,n,r,h,d,y,m){f(r,n,h);var x,_,g,b=function(t){if(!p&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new r(this,t)}}return function(){return new r(this,t)}},w=n+" Iterator",j="values"==d,O=!1,S=t.prototype,P=S[l]||S["@@iterator"]||d&&S[d],T=P||b(d),M=d?j?b("entries"):T:void 0,E="Array"==n&&S.entries||P;if(E&&(g=a(E.call(new t)))!==Object.prototype&&g.next&&(s(g,w,!0),e||"function"==typeof g[l]||c(g,l,v)),j&&P&&"values"!==P.name&&(O=!0,T=function(){return P.call(this)}),e&&!m||!p&&!O&&S[l]||c(S,l,T),u[n]=T,u[w]=v,d)if(x={values:j?T:b("values"),keys:y?T:b("keys"),entries:M},m)for(_ in x)_ in S||i(S,_,x[_]);else o(o.P+o.F*(p||O),n,x);return x}},function(t,n,r){var e=r(0).document;t.exports=e&&e.documentElement},function(t,n,r){var e=r(4),o=r(13),i=r(1)("species");t.exports=function(t,n){var r,c=e(t).constructor;return void 0===c||void 0==(r=e(c)[i])?n:o(r)}},function(t,n,r){var e,o,i,c=r(11),u=r(59),f=r(34),s=r(19),a=r(0),l=a.process,p=a.setImmediate,v=a.clearImmediate,h=a.MessageChannel,d=a.Dispatch,y=0,m={},x=function(){var t=+this;if(m.hasOwnProperty(t)){var n=m[t];delete m[t],n()}},_=function(t){x.call(t.data)};p&&v||(p=function(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return m[++y]=function(){u("function"==typeof t?t:Function(t),n)},e(y),y},v=function(t){delete m[t]},"process"==r(14)(l)?e=function(t){l.nextTick(c(x,t,1))}:d&&d.now?e=function(t){d.now(c(x,t,1))}:h?(i=(o=new h).port2,o.port1.onmessage=_,e=c(i.postMessage,i,1)):a.addEventListener&&"function"==typeof postMessage&&!a.importScripts?(e=function(t){a.postMessage(t+"","*")},a.addEventListener("message",_,!1)):e="onreadystatechange"in s("script")?function(t){f.appendChild(s("script")).onreadystatechange=function(){f.removeChild(this),x.call(t)}}:function(t){setTimeout(c(x,t,1),0)}),t.exports={set:p,clear:v}},function(t,n){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,n,r){var e=r(4),o=r(5),i=r(23);t.exports=function(t,n){if(e(t),o(n)&&n.constructor===t)return n;var r=i.f(t);return(0,r.resolve)(n),r.promise}},function(t,n,r){var e=r(20);t.exports=function(t){return Object(e(t))}},function(t,n,r){"use strict";var e=r(66)(!0);r(33)(String,"String",function(t){this._t=t+"",this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){var e=r(57),o=r(31);t.exports=Object.keys||function(t){return e(t,o)}},function(t,n,r){r(62);for(var e=r(0),o=r(6),i=r(9),c=r(1)("toStringTag"),u="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f<u.length;f++){var s=u[f],a=e[s],l=a&&a.prototype;l&&!l[c]&&o(l,c,s),i[s]=i.Array}},function(t,n,r){var e=r(32),o=r(1)("iterator"),i=r(9);t.exports=r(3).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[e(t)]}},function(t,n){},function(t,n,r){var e=r(11),o=r(51),i=r(52),c=r(4),u=r(27),f=r(43),s={},a={};(n=t.exports=function(t,n,r,l,p){var v,h,d,y,m=p?function(){return t}:f(t),x=e(r,l,n?2:1),_=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(v=u(t.length);v>_;_++)if((y=n?x(c(h=t[_])[0],h[1]):x(t[_]))===s||y===a)return y}else for(d=m.call(t);!(h=d.next()).done;)if((y=o(d,x,h.value,n))===s||y===a)return y}).BREAK=s,n.RETURN=a},function(t,n,r){var e=r(5);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(14);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){t.exports=r(6)},function(t,n,r){var e=r(4),o=r(55),i=r(31),c=r(22)("IE_PROTO"),u=function(){},f=function(){var t,n=r(19)("iframe"),e=i.length;for(n.style.display="none",r(34).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),f=t.F;e--;)delete f.prototype[i[e]];return f()};t.exports=Object.create||function(t,n){var r;return null!==t?(u.prototype=e(t),r=new u,u.prototype=null,r[c]=t):r=f(),void 0===n?r:o(r,n)}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var e=r(4);t.exports=function(t,n,r,o){try{return o?n(e(r)[0],r[1]):n(r)}catch(n){var i=t.return;throw void 0!==i&&e(i.call(t)),n}}},function(t,n,r){var e=r(9),o=r(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||i[o]===t)}},function(t,n,r){var e=r(6);t.exports=function(t,n,r){for(var o in n)r&&t[o]?t[o]=n[o]:e(t,o,n[o]);return t}},function(t,n,r){var e=r(1)("iterator"),o=!1;try{var i=[7][e]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,n){if(!n&&!o)return!1;var r=!1;try{var i=[7],c=i[e]();c.next=function(){return{done:r=!0}},i[e]=function(){return c},t(i)}catch(t){}return r}},function(t,n,r){var e=r(10),o=r(4),i=r(41);t.exports=r(8)?Object.defineProperties:function(t,n){o(t);for(var r,c=i(n),u=c.length,f=0;u>f;)e.f(t,r=c[f++],n[r]);return t}},function(t,n,r){t.exports=!r(8)&&!r(18)(function(){return 7!=Object.defineProperty(r(19)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(12),o=r(15),i=r(60)(!1),c=r(22)("IE_PROTO");t.exports=function(t,n){var r,u=o(t),f=0,s=[];for(r in u)r!=c&&e(u,r)&&s.push(r);for(;n.length>f;)e(u,r=n[f++])&&(~i(s,r)||s.push(r));return s}},function(t,n,r){var e=r(12),o=r(39),i=r(22)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),e(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?c:null}},function(t,n){t.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},function(t,n,r){var e=r(15),o=r(27),i=r(61);t.exports=function(t){return function(n,r,c){var u,f=e(n),s=o(f.length),a=i(c,s);if(t&&r!=r){for(;s>a;)if((u=f[a++])!=u)return!0}else for(;s>a;a++)if((t||a in f)&&f[a]===r)return t||a||0;return!t&&-1}}},function(t,n,r){var e=r(21),o=Math.max,i=Math.min;t.exports=function(t,n){return(t=e(t))<0?o(t+n,0):i(t,n)}},function(t,n,r){"use strict";var e=r(63),o=r(64),i=r(9),c=r(15);t.exports=r(33)(Array,"Array",function(t,n){this._t=c(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,o(1)):o(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),i.Arguments=i.Array,e("keys"),e("values"),e("entries")},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){"use strict";var e=r(49),o=r(25),i=r(17),c={};r(6)(c,r(1)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(c,{next:o(1,r)}),i(t,n+" Iterator")}},function(t,n,r){var e=r(21),o=r(20);t.exports=function(t){return function(n,r){var i,c,u=o(n)+"",f=e(r),s=u.length;return f<0||f>=s?t?"":void 0:(i=u.charCodeAt(f))<55296||i>56319||f+1===s||(c=u.charCodeAt(f+1))<56320||c>57343?t?u.charAt(f):i:t?u.slice(f,f+2):c-56320+(i-55296<<10)+65536}}},function(t,n,r){r(44),r(40),r(42),r(68),r(71),r(72),t.exports=r(3).Promise},function(t,n,r){"use strict";var e,o,i,c,u=r(29),f=r(0),s=r(11),a=r(32),l=r(7),p=r(5),v=r(13),h=r(50),d=r(45),y=r(35),m=r(36).set,x=r(69)(),_=r(23),g=r(37),b=r(38),w=f.TypeError,j=f.process,O=f.Promise,S="process"==a(j),P=function(){},T=o=_.f,M=!!function(){try{var t=O.resolve(1),n=(t.constructor={})[r(1)("species")]=function(t){t(P,P)};return(S||"function"==typeof PromiseRejectionEvent)&&t.then(P)instanceof n}catch(t){}}(),E=function(t){var n;return!(!p(t)||"function"!=typeof(n=t.then))&&n},L=function(t,n){if(!t._n){t._n=!0;var r=t._c;x(function(){for(var e=t._v,o=1==t._s,i=0,c=function(n){var r,i,c,u=o?n.ok:n.fail,f=n.resolve,s=n.reject,a=n.domain;try{u?(o||(2==t._h&&F(t),t._h=1),!0===u?r=e:(a&&a.enter(),r=u(e),a&&(a.exit(),c=!0)),r===n.promise?s(w("Promise-chain cycle")):(i=E(r))?i.call(r,f,s):f(r)):s(e)}catch(t){a&&!c&&a.exit(),s(t)}};r.length>i;)c(r[i++]);t._c=[],t._n=!1,n&&!t._h&&A(t)})}},A=function(t){m.call(f,function(){var n,r,e,o=t._v,i=k(t);if(i&&(n=g(function(){S?j.emit("unhandledRejection",o,t):(r=f.onunhandledrejection)?r({promise:t,reason:o}):(e=f.console)&&e.error&&e.error("Unhandled promise rejection",o)}),t._h=S||k(t)?2:1),t._a=void 0,i&&n.e)throw n.v})},k=function(t){return 1!==t._h&&0===(t._a||t._c).length},F=function(t){m.call(f,function(){var n;S?j.emit("rejectionHandled",t):(n=f.onrejectionhandled)&&n({promise:t,reason:t._v})})},C=function(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),L(n,!0))},R=function(t){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw w("Promise can't be resolved itself");(n=E(t))?x(function(){var e={_w:r,_d:!1};try{n.call(t,s(R,e,1),s(C,e,1))}catch(t){C.call(e,t)}}):(r._v=t,r._s=1,L(r,!1))}catch(t){C.call({_w:r,_d:!1},t)}}};M||(O=function(t){h(this,O,"Promise","_h"),v(t),e.call(this);try{t(s(R,this,1),s(C,this,1))}catch(t){C.call(this,t)}},(e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(53)(O.prototype,{then:function(t,n){var r=T(y(this,O));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=S?j.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&L(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new e;this.promise=t,this.resolve=s(R,t,1),this.reject=s(C,t,1)},_.f=T=function(t){return t===O||t===c?new i(t):o(t)}),l(l.G+l.W+l.F*!M,{Promise:O}),r(17)(O,"Promise"),r(70)("Promise"),c=r(3).Promise,l(l.S+l.F*!M,"Promise",{reject:function(t){var n=T(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(u||!M),"Promise",{resolve:function(t){return b(u&&this===c?O:this,t)}}),l(l.S+l.F*!(M&&r(54)(function(t){O.all(t).catch(P)})),"Promise",{all:function(t){var n=this,r=T(n),e=r.resolve,o=r.reject,i=g(function(){var r=[],i=0,c=1;d(t,!1,function(t){var u=i++,f=!1;r.push(void 0),c++,n.resolve(t).then(function(t){f||(f=!0,r[u]=t,--c||e(r))},o)}),--c||e(r)});return i.e&&o(i.v),r.promise},race:function(t){var n=this,r=T(n),e=r.reject,o=g(function(){d(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return o.e&&e(o.v),r.promise}})},function(t,n,r){var e=r(0),o=r(36).set,i=e.MutationObserver||e.WebKitMutationObserver,c=e.process,u=e.Promise,f="process"==r(14)(c);t.exports=function(){var t,n,r,s=function(){var e,o;for(f&&(e=c.domain)&&e.exit();t;){o=t.fn,t=t.next;try{o()}catch(e){throw t?r():n=void 0,e}}n=void 0,e&&e.enter()};if(f)r=function(){c.nextTick(s)};else if(!i||e.navigator&&e.navigator.standalone)if(u&&u.resolve){var a=u.resolve();r=function(){a.then(s)}}else r=function(){o.call(e,s)};else{var l=!0,p=document.createTextNode("");new i(s).observe(p,{characterData:!0}),r=function(){p.data=l=!l}}return function(e){var o={fn:e,next:void 0};n&&(n.next=o),t||(t=o,r()),n=o}}},function(t,n,r){"use strict";var e=r(0),o=r(3),i=r(10),c=r(8),u=r(1)("species");t.exports=function(t){var n="function"==typeof o[t]?o[t]:e[t];c&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,r){"use strict";var e=r(7),o=r(3),i=r(0),c=r(35),u=r(38);e(e.P+e.R,"Promise",{finally:function(t){var n=c(this,o.Promise||i.Promise),r="function"==typeof t;return this.then(r?function(r){return u(n,t()).then(function(){return r})}:t,r?function(r){return u(n,t()).then(function(){throw r})}:t)}})},function(t,n,r){"use strict";var e=r(7),o=r(23),i=r(37);e(e.S,"Promise",{try:function(t){var n=o.f(this),r=i(t);return(r.e?n.reject:n.resolve)(r.v),n.promise}})},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,n,r){"use strict";r.r(n);var e=r(2),o=r.n(e),i=r(24),c=r(16);n.default=function(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return this.then(function(e){if(!Object(i.a)(e))throw TypeError("forEachAF cannot be called on ".concat(e,", only on an Array or array-like Object"));if("function"!=typeof t)throw TypeError("".concat(t," is not a function"));return(n.inSeries?Object(c.b)(e).then(function(n){return n.reduce(function(n,e,i,c){return n.then(function(){return o.a.resolve(t.call(r,e,i,c))})},o.a.resolve())}):Object(c.a)(e,t,r)).then(function(){})})}}]).default},"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("forEachAF",[],n):"object"==typeof exports?exports.forEachAF=n():t.forEachAF=n();
//# sourceMappingURL=min.js.map
/*!
* @async-af/foreach/min v6.0.0
* @async-af/foreach/min v7.0.0
*
* AsyncAF (Async/Await Fun) forEachAF method
* AsyncAF (The asynciest of async libs there ever was or ever will be...AsyncAF!?) forEachAF method
* (https://async-af.js.org/AsyncAF#forEachAF)

@@ -12,3 +12,3 @@ *

*/
var e,r;e="undefined"!=typeof self?self:this,r=function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=17)}({0:function(e,r,t){"use strict";r.a=function(e){return Array.isArray(e)||null!=e&&null!=e.length}},17:function(e,r,t){"use strict";t.r(r);var n=t(0);r.default=function(e,r){return this.then(t=>{if(!Object(n.a)(t))throw TypeError(`forEachAF cannot be called on ${t}, only on an Array or array-like Object`);return Array.prototype.forEach.call(t,e,r)})}}}).default},"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("forEachAF",[],r):"object"==typeof exports?exports.forEachAF=r():e.forEachAF=r();
var e,t;e="undefined"!=typeof self?self:this,t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=8)}([function(e,t,r){"use strict";r.d(t,"b",function(){return o}),r.d(t,"a",function(){return u});var n=r(2);const o=e=>(function t(r,n){const o=r.length;if(!o)return Promise.resolve(r);const u=!(n in e);return Promise.resolve(e[n]).then(e=>(u||(r[n]=e),n===o-1?r:t(r,n+1)))})(Array(e.length>>>0),0),u=(e,t,r)=>Object(n.a)(e,e=>e).then(t?e=>Object(n.a)(Array.prototype.map.call(e,t,r)):void 0)},function(e,t,r){"use strict";t.a=function(e){return Array.isArray(e)||null!=e&&null!=e.length}},function(e,t,r){"use strict";t.a=(e=>new Promise((t,r)=>{const n=e.length>>>0,o=Array(n);let u=n,i=n;if(!n)return t(o);const c=n=>Promise.resolve(e[n]).then(r=>{n in e&&(o[n]=r),--u||t(o)},r);for(;i--;)c(i)}))},,,,,,function(e,t,r){"use strict";r.r(t);var n=r(1),o=r(0);t.default=function(e,t){return this.then(r=>{if(!Object(n.a)(r))throw TypeError(`forEachAF cannot be called on ${r}, only on an Array or array-like Object`);if("function"!=typeof e)throw TypeError(`${e} is not a function`);return(this.inSeries?Object(o.b)(r).then(r=>r.reduce((r,n,o,u)=>r.then(()=>Promise.resolve(e.call(t,n,o,u))),Promise.resolve())):Object(o.a)(r,e,t)).then(()=>{})})}}]).default},"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("forEachAF",[],t):"object"==typeof exports?exports.forEachAF=t():e.forEachAF=t();
//# sourceMappingURL=min.js.map

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "6.0.0",
"version": "7.0.0",
"homepage": "https://async-af.js.org",

@@ -28,2 +28,5 @@ "bugs": {

"methods",
"parallel",
"series",
"serial",
"map",

@@ -30,0 +33,0 @@ "forEach",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc