Comparing version 1.0.4 to 1.1.0
@@ -77,2 +77,3 @@ import _regeneratorRuntime from "babel-runtime/regenerator"; | ||
if (success) { | ||
nextFn.resolve(res); | ||
onSuccesses.forEach(function (d) { | ||
@@ -82,2 +83,3 @@ return d(res, nextFn); | ||
} else { | ||
nextFn.reject(error); | ||
onErrors.forEach(function (d) { | ||
@@ -106,4 +108,8 @@ return d(error, nextFn); | ||
add: function add(fn) { | ||
pending.push(fn); | ||
tick(); | ||
return new Promise(function (resolve, reject) { | ||
pending.push(fn); | ||
fn.resolve = resolve; | ||
fn.reject = reject; | ||
tick(); | ||
}); | ||
}, | ||
@@ -110,0 +116,0 @@ throttle: function throttle(n) { |
@@ -88,2 +88,3 @@ "use strict"; | ||
if (success) { | ||
nextFn.resolve(res); | ||
onSuccesses.forEach(function (d) { | ||
@@ -93,2 +94,3 @@ return d(res, nextFn); | ||
} else { | ||
nextFn.reject(error); | ||
onErrors.forEach(function (d) { | ||
@@ -117,4 +119,8 @@ return d(error, nextFn); | ||
add: function add(fn) { | ||
pending.push(fn); | ||
tick(); | ||
return new Promise(function (resolve, reject) { | ||
pending.push(fn); | ||
fn.resolve = resolve; | ||
fn.reject = reject; | ||
tick(); | ||
}); | ||
}, | ||
@@ -121,0 +127,0 @@ throttle: function throttle(n) { |
{ | ||
"name": "swimmer", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "An async task pooling and throttling utility for javascript.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -98,4 +98,4 @@ # 🏊 swimmer | ||
const doIntenseTasks = () => { | ||
// Add some tasks to the pool. | ||
const doIntenseTasks = async () => { | ||
// Add more tasks to the pool. | ||
tasks.forEach( | ||
@@ -116,10 +116,12 @@ url => pool.add( | ||
// Add some more tasks! | ||
otherUrls.forEach( | ||
url => pool.add( | ||
() => fetch(url) | ||
) | ||
) | ||
// Add a single task and WAIT for it's completion/failure | ||
try { | ||
const res = await pool.add(() => fetch('http://custom.com/asset.json')) | ||
console.log('A custom asset!', res) | ||
} catch (err) { | ||
console.log('Darn! An error...') | ||
throw err | ||
} | ||
// Clear the pool. Any running tasks will continue until finished. | ||
// Then clear the pool. Any running tasks will attempt to finished. | ||
pool.clear() | ||
@@ -126,0 +128,0 @@ } |
/*! | ||
* swimmer v1.0.4 - https://github.com/tannerlinsley/swimmer | ||
* swimmer v1.1.0 - https://github.com/tannerlinsley/swimmer | ||
* MIT Licensed | ||
@@ -173,2 +173,3 @@ */ | ||
if (success) { | ||
nextFn.resolve(res); | ||
onSuccesses.forEach(function (d) { | ||
@@ -178,2 +179,3 @@ return d(res, nextFn); | ||
} else { | ||
nextFn.reject(error); | ||
onErrors.forEach(function (d) { | ||
@@ -202,4 +204,8 @@ return d(error, nextFn); | ||
add: function add(fn) { | ||
pending.push(fn); | ||
tick(); | ||
return new Promise(function (resolve, reject) { | ||
pending.push(fn); | ||
fn.resolve = resolve; | ||
fn.reject = reject; | ||
tick(); | ||
}); | ||
}, | ||
@@ -206,0 +212,0 @@ throttle: function throttle(n) { |
/*! | ||
* swimmer v1.0.4 - https://github.com/tannerlinsley/swimmer | ||
* swimmer v1.1.0 - https://github.com/tannerlinsley/swimmer | ||
* MIT Licensed | ||
*/ | ||
!function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}("undefined"!=typeof self?self:this,function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=0)}([function(t,r,e){t.exports=e(1)},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createPool=c,r.poolAll=function(t,r){var e=this;return new Promise(function(n,i){var u=c(r),f=[];u.onSettled(function(){n(f)}),u.onError(function(t){i(t)}),t.forEach(function(t,r){u.add(a(o.a.mark(function n(){var i;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:return i=e.sent,f[r]=i,e.abrupt("return",i);case 5:case"end":return e.stop()}},n,e)})))}),u.start()})};var n=e(2),o=e.n(n),i=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};function a(t){return function(){var r=t.apply(this,arguments);return new Promise(function(t,e){return function n(o,i){try{var a=r[o](i),u=a.value}catch(t){return void e(t)}if(!a.done)return Promise.resolve(u).then(function(t){n("next",t)},function(t){n("throw",t)});t(u)}("next")})}}var u={concurrency:5,started:!0,tasks:[]};function c(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=i({},u,r),n=e.concurrency,c=[],f=[],s=[],h=e.started,l=[],p=e.tasks,v=n,y=function r(){if(h)if(p.length||l.length)for(var e=function(){var e=p.shift();l.push(e),a(o.a.mark(function n(){var i,a,u;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=!1,a=void 0,u=void 0,t.prev=3,t.next=6,e();case 6:a=t.sent,i=!0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),u=t.t0;case 13:l=l.filter(function(t){return t!==e}),i?s.forEach(function(t){return t(a,e)}):f.forEach(function(t){return t(u,e)}),r();case 16:case"end":return t.stop()}},n,t,[[3,10]])}))()};l.length<v&&p.length;)e();else c.forEach(function(t){return t()})};return{add:function(t){p.push(t),y()},throttle:function(t){v=t},onSettled:function(t){return c.push(t),function(){c=c.filter(function(r){return r!==t})}},onError:function(t){return f.push(t),function(){f=f.filter(function(r){return r!==t})}},onSuccess:function(t){return s.push(t),function(){s=s.filter(function(r){return r!==t})}},stop:function(){h=!1},start:function(){h=!0,y()},clear:function(){p=[]},getActive:function(){return l},getPending:function(){return p},getAll:function(){return[].concat(l,p)},isRunning:function(){return h},isSettled:function(){return!h&&!l.length&&!p.length}}}},function(t,r,e){t.exports=e(3)},function(t,r,e){var n=function(){return this}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=e(4),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},function(t,r){!function(r){"use strict";var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",f="object"==typeof t,s=r.regeneratorRuntime;if(s)f&&(t.exports=s);else{(s=r.regeneratorRuntime=f?t.exports:{}).wrap=x;var h="suspendedStart",l="suspendedYield",p="executing",v="completed",y={},d={};d[a]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(N([])));m&&m!==n&&o.call(m,a)&&(d=m);var w=O.prototype=E.prototype=Object.create(d);L.prototype=w.constructor=O,O.constructor=L,O[c]=L.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===L||"GeneratorFunction"===(r.displayName||r.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{__await:t}},j(_.prototype),_.prototype[u]=function(){return this},s.AsyncIterator=_,s.async=function(t,r,e,n){var o=new _(x(t,r,e,n));return s.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},j(w),w[c]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},s.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},s.values=N,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return u.type="throw",u.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),R(e),y}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;R(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}}}function x(t,r,e,n){var o=r&&r.prototype instanceof E?r:E,i=Object.create(o.prototype),a=new S(n||[]);return i._invoke=function(t,r,e){var n=h;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return G()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var u=P(a,e);if(u){if(u===y)continue;return u}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===h)throw n=v,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=p;var c=b(t,r,e);if("normal"===c.type){if(n=e.done?v:l,c.arg===y)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n=v,e.method="throw",e.arg=c.arg)}}}(t,e,a),i}function b(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}function E(){}function L(){}function O(){}function j(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function _(t){var r;this._invoke=function(e,n){function i(){return new Promise(function(r,i){!function r(e,n,i,a){var u=b(t[e],t,n);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){r("next",t,i,a)},function(t){r("throw",t,i,a)}):Promise.resolve(f).then(function(t){c.value=t,i(c)},a)}a(u.arg)}(e,n,r,i)})}return r=r?r.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=b(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function R(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function N(t){if(t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:G}}function G(){return{value:e,done:!0}}}(function(){return this}()||Function("return this")())}]).default}); | ||
!function(t,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var e=r();for(var n in e)("object"==typeof exports?exports:t)[n]=e[n]}}("undefined"!=typeof self?self:this,function(){return function(t){var r={};function e(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="",e(e.s=0)}([function(t,r,e){t.exports=e(1)},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createPool=c,r.poolAll=function(t,r){var e=this;return new Promise(function(n,i){var a=c(r),f=[];a.onSettled(function(){n(f)}),a.onError(function(t){i(t)}),t.forEach(function(t,r){a.add(u(o.a.mark(function n(){var i;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t();case 2:return i=e.sent,f[r]=i,e.abrupt("return",i);case 5:case"end":return e.stop()}},n,e)})))}),a.start()})};var n=e(2),o=e.n(n),i=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};function u(t){return function(){var r=t.apply(this,arguments);return new Promise(function(t,e){return function n(o,i){try{var u=r[o](i),a=u.value}catch(t){return void e(t)}if(!u.done)return Promise.resolve(a).then(function(t){n("next",t)},function(t){n("throw",t)});t(a)}("next")})}}var a={concurrency:5,started:!0,tasks:[]};function c(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=i({},a,r),n=e.concurrency,c=[],f=[],s=[],h=e.started,l=[],p=e.tasks,v=n,y=function r(){if(h)if(p.length||l.length)for(var e=function(){var e=p.shift();l.push(e),u(o.a.mark(function n(){var i,u,a;return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=!1,u=void 0,a=void 0,t.prev=3,t.next=6,e();case 6:u=t.sent,i=!0,t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),a=t.t0;case 13:l=l.filter(function(t){return t!==e}),i?(e.resolve(u),s.forEach(function(t){return t(u,e)})):(e.reject(a),f.forEach(function(t){return t(a,e)})),r();case 16:case"end":return t.stop()}},n,t,[[3,10]])}))()};l.length<v&&p.length;)e();else c.forEach(function(t){return t()})};return{add:function(t){return new Promise(function(r,e){p.push(t),t.resolve=r,t.reject=e,y()})},throttle:function(t){v=t},onSettled:function(t){return c.push(t),function(){c=c.filter(function(r){return r!==t})}},onError:function(t){return f.push(t),function(){f=f.filter(function(r){return r!==t})}},onSuccess:function(t){return s.push(t),function(){s=s.filter(function(r){return r!==t})}},stop:function(){h=!1},start:function(){h=!0,y()},clear:function(){p=[]},getActive:function(){return l},getPending:function(){return p},getAll:function(){return[].concat(l,p)},isRunning:function(){return h},isSettled:function(){return!h&&!l.length&&!p.length}}}},function(t,r,e){t.exports=e(3)},function(t,r,e){var n=function(){return this}()||Function("return this")(),o=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0,i=o&&n.regeneratorRuntime;if(n.regeneratorRuntime=void 0,t.exports=e(4),o)n.regeneratorRuntime=i;else try{delete n.regeneratorRuntime}catch(t){n.regeneratorRuntime=void 0}},function(t,r){!function(r){"use strict";var e,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",f="object"==typeof t,s=r.regeneratorRuntime;if(s)f&&(t.exports=s);else{(s=r.regeneratorRuntime=f?t.exports:{}).wrap=x;var h="suspendedStart",l="suspendedYield",p="executing",v="completed",y={},d={};d[u]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(N([])));m&&m!==n&&o.call(m,u)&&(d=m);var w=j.prototype=E.prototype=Object.create(d);L.prototype=w.constructor=j,j.constructor=L,j[c]=L.displayName="GeneratorFunction",s.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===L||"GeneratorFunction"===(r.displayName||r.name))},s.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,j):(t.__proto__=j,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(w),t},s.awrap=function(t){return{__await:t}},O(_.prototype),_.prototype[a]=function(){return this},s.AsyncIterator=_,s.async=function(t,r,e,n){var o=new _(x(t,r,e,n));return s.isGeneratorFunction(r)?o:o.next().then(function(t){return t.done?t.value:o.next()})},O(w),w[c]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},s.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},s.values=N,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],a=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var c=o.call(u,"catchLoc"),f=o.call(u,"finallyLoc");if(c&&f){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var u=i?i.completion:{};return u.type=t,u.arg=r,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(u)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),y},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),R(e),y}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;R(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}}}function x(t,r,e,n){var o=r&&r.prototype instanceof E?r:E,i=Object.create(o.prototype),u=new S(n||[]);return i._invoke=function(t,r,e){var n=h;return function(o,i){if(n===p)throw new Error("Generator is already running");if(n===v){if("throw"===o)throw i;return G()}for(e.method=o,e.arg=i;;){var u=e.delegate;if(u){var a=P(u,e);if(a){if(a===y)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if(n===h)throw n=v,e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n=p;var c=b(t,r,e);if("normal"===c.type){if(n=e.done?v:l,c.arg===y)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n=v,e.method="throw",e.arg=c.arg)}}}(t,e,u),i}function b(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}function E(){}function L(){}function j(){}function O(t){["next","throw","return"].forEach(function(r){t[r]=function(t){return this._invoke(r,t)}})}function _(t){var r;this._invoke=function(e,n){function i(){return new Promise(function(r,i){!function r(e,n,i,u){var a=b(t[e],t,n);if("throw"!==a.type){var c=a.arg,f=c.value;return f&&"object"==typeof f&&o.call(f,"__await")?Promise.resolve(f.__await).then(function(t){r("next",t,i,u)},function(t){r("throw",t,i,u)}):Promise.resolve(f).then(function(t){c.value=t,i(c)},u)}u(a.arg)}(e,n,r,i)})}return r=r?r.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=b(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function R(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function N(t){if(t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(o.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}return{next:G}}function G(){return{value:e,done:!0}}}(function(){return this}()||Function("return this")())}]).default}); | ||
//# sourceMappingURL=swimmer.min.js.map |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
111195
1354
179