Socket
Socket
Sign inDemoInstall

rsvp

Package Overview
Dependencies
0
Maintainers
6
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.1 to 4.0.2

2

dist/rsvp.min.js

@@ -1,1 +0,1 @@

(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.RSVP=t.RSVP||{})})(this,function(t){"use strict";function e(t){var e=t._promiseCallbacks;e||(e=t._promiseCallbacks={});return e}function r(t,e){if(2!==arguments.length)return Ot[t];Ot[t]=e}function n(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function o(t){return"function"==typeof t}function i(t){return null!==t&&"object"==typeof t}function u(t){return null!==t&&"object"==typeof t}function s(){setTimeout(function(){for(var t=0;t<At.length;t++){var e=At[t],r=e.payload;r.guid=r.key+r.id;r.childGuid=r.key+r.childId;r.error&&(r.stack=r.error.stack);Ot.trigger(e.name,e.payload)}At.length=0},50)}function c(t,e,r){1===At.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:r&&r._id,label:e._label,timeStamp:Date.now(),error:Ot["instrument-with-stack"]?new Error(e._label):null}})&&s()}function a(t,e){var r=this;if(t&&"object"==typeof t&&t.constructor===r)return t;var n=new r(l,e);w(n,t);return n}function f(){return new TypeError("A promises callback cannot return that same promise.")}function l(){}function h(){this.error=null}function p(t){try{return t.then}catch(e){Rt.error=e;return Rt}}function y(){try{var t=kt;kt=null;return t.apply(this,arguments)}catch(e){xt.error=e;return xt}}function _(t){kt=t;return y}function d(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function v(t,e,r){Ot.async(function(t){var n=!1,o=d(r,e,function(r){if(!n){n=!0;e!==r?w(t,r,void 0):j(t,r)}},function(e){if(!n){n=!0;E(t,e)}},"Settle: "+(t._label||" unknown promise"));if(!n&&o){n=!0;E(t,o)}},t)}function b(t,e){if(e._state===Pt)j(t,e._result);else if(e._state===St){e._onError=null;E(t,e._result)}else O(e,void 0,function(r){e!==r?w(t,r,void 0):j(t,r)},function(e){return E(t,e)})}function m(t,e,r){var n=e.constructor===t.constructor&&r===S&&t.constructor.resolve===a;if(n)b(t,e);else if(r===Rt){E(t,Rt.error);Rt.error=null}else o(r)?v(t,e,r):j(t,e)}function w(t,e){t===e?j(t,e):n(e)?m(t,e,p(e)):j(t,e)}function g(t){t._onError&&t._onError(t._result);A(t)}function j(t,e){if(t._state===Tt){t._result=e;t._state=Pt;0===t._subscribers.length?Ot.instrument&&c("fulfilled",t):Ot.async(A,t)}}function E(t,e){if(t._state===Tt){t._state=St;t._result=e;Ot.async(g,t)}}function O(t,e,r,n){var o=t._subscribers,i=o.length;t._onError=null;o[i]=e;o[i+Pt]=r;o[i+St]=n;0===i&&t._state&&Ot.async(A,t)}function A(t){var e=t._subscribers,r=t._state;Ot.instrument&&c(r===Pt?"fulfilled":"rejected",t);if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3){n=e[u];o=e[u+r];n?T(r,n,o,i):o(i)}t._subscribers.length=0}}function T(t,e,r,n){var i=o(r),u=void 0,s=void 0;if(i){u=_(r)(n);if(u===xt){s=u.error;u.error=null}else if(u===e){E(e,f());return}}else u=n;e._state!==Tt||(i&&void 0===s?w(e,u):void 0!==s?E(e,s):t===Pt?j(e,u):t===St&&E(e,u))}function P(t,e){var r=!1;try{e(function(e){if(!r){r=!0;w(t,e)}},function(e){if(!r){r=!0;E(t,e)}})}catch(n){E(t,n)}}function S(t,e,r){var n=this,o=n._state;if(o===Pt&&!t||o===St&&!e){Ot.instrument&&c("chained",n,n);return n}n._onError=null;var i=new n.constructor(l,r),u=n._result;Ot.instrument&&c("chained",n,i);if(o===Tt)O(n,i,t,e);else{var s=o===Pt?t:e;Ot.async(function(){return T(o,i,s,u)})}return i}function R(t,e,r){this._remaining--;t===Pt?this._result[e]={state:"fulfilled",value:r}:this._result[e]={state:"rejected",reason:r}}function x(t,e){return Array.isArray(t)?new Mt(this,t,(!0),e).promise:this.reject(new TypeError("Promise.all must be called with an array"),e)}function k(t,e){var r=this,n=new r(l,e);if(!Array.isArray(t)){E(n,new TypeError("Promise.race must be called with an array"));return n}for(var o=0;n._state===Tt&&o<t.length;o++)O(r.resolve(t[o]),void 0,function(t){return w(n,t)},function(t){return E(n,t)});return n}function M(t,e){var r=this,n=new r(l,e);E(n,t);return n}function C(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(){this.value=void 0}function N(t){try{return t.then}catch(e){Nt.value=e;return Nt}}function V(t,e,r){try{t.apply(e,r)}catch(n){Nt.value=n;return Nt}}function U(t,e){for(var r={},n=t.length,o=new Array(n),i=0;i<n;i++)o[i]=t[i];for(var u=0;u<e.length;u++){var s=e[u];r[s]=o[u+1]}return r}function D(t){for(var e=t.length,r=new Array(e-1),n=1;n<e;n++)r[n-1]=t[n];return r}function K(t,e){return{then:function(r,n){return t.call(e,r,n)}}}function q(t,e){var r=function(){for(var r=this,n=arguments.length,o=new Array(n+1),i=!1,u=0;u<n;++u){var s=arguments[u];if(!i){i=W(s);if(i===Vt){var c=new It(l);E(c,Vt.value);return c}i&&i!==!0&&(s=K(i,s))}o[u]=s}var a=new It(l);o[n]=function(t,r){t?E(a,t):void 0===e?w(a,r):e===!0?w(a,D(arguments)):Array.isArray(e)?w(a,U(arguments,e)):w(a,r)};return i?L(a,o,t,r):G(a,o,t,r)};r.__proto__=t;return r}function G(t,e,r,n){var o=V(r,n,e);o===Nt&&E(t,o.value);return t}function L(t,e,r,n){return It.all(e).then(function(e){var o=V(r,n,e);o===Nt&&E(t,o.value);return t})}function W(t){return!(!t||"object"!=typeof t)&&(t.constructor===It||N(t))}function Y(t,e){return It.all(t,e)}function $(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function z(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function B(t,e){return Array.isArray(t)?new Ut(It,t,e).promise:It.reject(new TypeError("Promise.allSettled must be called with an array"),e)}function H(t,e){return It.race(t,e)}function J(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function X(t,e){return i(t)?new Kt(It,t,e).promise:It.reject(new TypeError("Promise.hash must be called with an object"),e)}function Z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function tt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function et(t,e){return i(t)?new qt(It,t,(!1),e).promise:It.reject(new TypeError("RSVP.hashSettled must be called with an object"),e)}function rt(t){setTimeout(function(){throw t});throw t}function nt(t){var e={resolve:void 0,reject:void 0};e.promise=new It(function(t,r){e.resolve=t;e.reject=r},t);return e}function ot(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function it(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function ut(t,e,r){return Array.isArray(t)?o(e)?new Gt(It,t,e,r).promise:It.reject(new TypeError("RSVP.map expects a function as a second argument"),r):It.reject(new TypeError("RSVP.map must be called with an array"),r)}function st(t,e){return It.resolve(t,e)}function ct(t,e){return It.reject(t,e)}function at(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function ft(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function lt(t,e,r){return Array.isArray(t)||i(t)&&void 0!==t.then?o(e)?It.resolve(t,r).then(function(t){return new Wt(It,t,e,r).promise}):It.reject(new TypeError("RSVP.filter expects function as a second argument"),r):It.reject(new TypeError("RSVP.filter must be called with an array or promise"),r)}function ht(t,e){Xt[Yt]=t;Xt[Yt+1]=e;Yt+=2;2===Yt&&Zt()}function pt(){var t=process.nextTick,e=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate);return function(){return t(bt)}}function yt(){return"undefined"!=typeof $t?function(){$t(bt)}:vt()}function _t(){var t=0,e=new Ht(bt),r=document.createTextNode("");e.observe(r,{characterData:!0});return function(){return r.data=t=++t%2}}function dt(){var t=new MessageChannel;t.port1.onmessage=bt;return function(){return t.port2.postMessage(0)}}function vt(){return function(){return setTimeout(bt,1)}}function bt(){for(var t=0;t<Yt;t+=2){var e=Xt[t],r=Xt[t+1];e(r);Xt[t]=void 0;Xt[t+1]=void 0}Yt=0}function mt(){try{var t=require,e=t("vertx");$t=e.runOnLoop||e.runOnContext;return yt()}catch(r){return vt()}}function wt(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function gt(){Ot.on.apply(Ot,arguments)}function jt(){Ot.off.apply(Ot,arguments)}var Et={mixin:function(t){t.on=this.on;t.off=this.off;t.trigger=this.trigger;t._promiseCallbacks=void 0;return t},on:function(t,r){if("function"!=typeof r)throw new TypeError("Callback must be a function");var n=e(this),o=void 0;o=n[t];o||(o=n[t]=[]);o.indexOf(r)&&o.push(r)},off:function(t,r){var n=e(this),o=void 0,i=void 0;if(r){o=n[t];i=o.indexOf(r);i!==-1&&o.splice(i,1)}else n[t]=[]},trigger:function(t,r,n){var o=e(this),i=void 0,u=void 0;if(i=o[t])for(var s=0;s<i.length;s++){u=i[s];u(r,n)}}},Ot={instrument:!1};Et.mixin(Ot);var At=[],Tt=void 0,Pt=1,St=2,Rt=new h,xt=new h,kt=void 0,Mt=function(){function t(t,e,r,n){this._instanceConstructor=t;this.promise=new t(l,n);this._abortOnReject=r;this.isUsingOwnPromise=t===It;this._init.apply(this,arguments)}t.prototype._init=function(t,e){var r=e.length||0;this.length=r;this._remaining=r;this._result=new Array(r);this._enumerate(e)};t.prototype._enumerate=function(t){for(var e=this.length,r=this.promise,n=0;r._state===Tt&&n<e;n++)this._eachEntry(t[n],n,!0);this._checkFullfillment()};t.prototype._checkFullfillment=function(){0===this._remaining&&j(this.promise,this._result)};t.prototype._settleMaybeThenable=function(t,e,r){var n=this._instanceConstructor,o=n.resolve;if(o===a){var i=p(t);if(i===S&&t._state!==Tt){t._onError=null;this._settledAt(t._state,e,t._result,r)}else if("function"!=typeof i)this._settledAt(Pt,e,t,r);else if(this.isUsingOwnPromise){var u=new n(l);m(u,t,i);this._willSettleAt(u,e,r)}else this._willSettleAt(new n(function(e){return e(t)}),e,r)}else this._willSettleAt(o(t),e,r)};t.prototype._eachEntry=function(t,e,r){u(t)?this._settleMaybeThenable(t,e,r):this._setResultAt(Pt,e,t,r)};t.prototype._settledAt=function(t,e,r,n){var o=this.promise;if(o._state===Tt)if(this._abortOnReject&&t===St)E(o,r);else{this._setResultAt(t,e,r,n);this._checkFullfillment()}};t.prototype._setResultAt=function(t,e,r,n){this._remaining--;this._result[e]=r};t.prototype._willSettleAt=function(t,e,r){var n=this;O(t,void 0,function(t){return n._settledAt(Pt,e,t,r)},function(t){return n._settledAt(St,e,t,r)})};return t}(),Ct="rsvp_"+Date.now()+"-",Ft=0,It=function(){function t(e,r){this._id=Ft++;this._label=r;this._state=void 0;this._result=void 0;this._subscribers=[];Ot.instrument&&c("created",this);if(l!==e){"function"!=typeof e&&C();this instanceof t?P(this,e):F()}}t.prototype._onError=function(t){var e=this;Ot.after(function(){e._onError&&Ot.trigger("error",t,e._label)})};t.prototype["catch"]=function(t,e){return this.then(void 0,t,e)};t.prototype["finally"]=function(t,e){var r=this,n=r.constructor;return r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})},e)};return t}();It.cast=a;It.all=x;It.race=k;It.resolve=a;It.reject=M;It.prototype._guidKey=Ct;It.prototype.then=S;var Nt=new I,Vt=new I,Ut=function(t){function e(e,r,n){return $(this,t.call(this,e,r,!1,n))}z(e,t);return e}(Mt);Ut.prototype._setResultAt=R;var Dt=Object.prototype.hasOwnProperty,Kt=function(t){function e(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments[3];return J(this,t.call(this,e,r,n,o))}Q(e,t);e.prototype._init=function(t,e){this._result={};this._enumerate(e);0===this._remaining&&j(this.promise,this._result)};e.prototype._enumerate=function(t){var e=this.promise,r=[];for(var n in t)Dt.call(t,n)&&r.push({position:n,entry:t[n]});var o=r.length;this._remaining=o;for(var i=void 0,u=0;e._state===Tt&&u<o;u++){i=r[u];this._eachEntry(i.entry,i.position)}};return e}(Mt),qt=function(t){function e(e,r,n){return Z(this,t.call(this,e,r,!1,n))}tt(e,t);return e}(Kt);qt.prototype._setResultAt=R;var Gt=function(t){function e(e,r,n,o){return ot(this,t.call(this,e,r,!0,o,n))}it(e,t);e.prototype._init=function(t,e,r,n,o){var i=e.length||0;this.length=i;this._remaining=i;this._result=new Array(i);this._mapFn=o;this._enumerate(e)};e.prototype._setResultAt=function(t,e,r,n){if(n){var o=_(this._mapFn)(r,e);o===xt?this._settledAt(St,e,o.error,!1):this._eachEntry(o,e,!1)}else{this._remaining--;this._result[e]=r}};return e}(Mt),Lt={},Wt=function(t){function e(e,r,n,o){return at(this,t.call(this,e,r,!0,o,n))}ft(e,t);e.prototype._init=function(t,e,r,n,o){var i=e.length||0;this.length=i;this._remaining=i;this._result=new Array(i);this._filterFn=o;this._enumerate(e)};e.prototype._checkFullfillment=function(){if(0===this._remaining){this._result=this._result.filter(function(t){return t!==Lt});j(this.promise,this._result)}};e.prototype._setResultAt=function(t,e,r,n){if(n){this._result[e]=r;var o=_(this._filterFn)(r,e);o===xt?this._settledAt(St,e,o.error,!1):this._eachEntry(o,e,!1)}else{this._remaining--;r||(this._result[e]=Lt)}};return e}(Mt),Yt=0,$t=void 0,zt="undefined"!=typeof window?window:void 0,Bt=zt||{},Ht=Bt.MutationObserver||Bt.WebKitMutationObserver,Jt="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Qt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Xt=new Array(1e3),Zt=void 0;Zt=Jt?pt():Ht?_t():Qt?dt():void 0===zt&&"function"==typeof require?mt():vt();var te=void 0;if("object"==typeof self)te=self;else{if("object"!=typeof global)throw new Error("no global: `self` or `global` found");te=global}var ee;Ot.async=ht;Ot.after=function(t){return setTimeout(t,0)};var re=st,ne=function(t,e){return Ot.async(t,e)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var oe=window.__PROMISE_INSTRUMENTATION__;r("instrument",!0);for(var ie in oe)oe.hasOwnProperty(ie)&&gt(ie,oe[ie])}var ue=(ee={asap:ht,cast:re,Promise:It,EventTarget:Et,all:Y,allSettled:B,race:H,hash:X,hashSettled:et,rethrow:rt,defer:nt,denodeify:q,configure:r,on:gt,off:jt,resolve:st,reject:ct,map:ut},wt(ee,"async",ne),wt(ee,"filter",lt),ee);t["default"]=ue;t.asap=ht;t.cast=re;t.Promise=It;t.EventTarget=Et;t.all=Y;t.allSettled=B;t.race=H;t.hash=X;t.hashSettled=et;t.rethrow=rt;t.defer=nt;t.denodeify=q;t.configure=r;t.on=gt;t.off=jt;t.resolve=st;t.reject=ct;t.map=ut;t.async=ne;t.filter=lt;Object.defineProperty(t,"__esModule",{value:!0})});
(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.RSVP=t.RSVP||{})})(this,function(t){"use strict";function e(t){var e=t._promiseCallbacks;e||(e=t._promiseCallbacks={});return e}function r(t,e){if(2!==arguments.length)return Ot[t];Ot[t]=e}function n(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}function o(t){return"function"==typeof t}function i(t){return null!==t&&"object"==typeof t}function u(t){return null!==t&&"object"==typeof t}function s(){setTimeout(function(){for(var t=0;t<At.length;t++){var e=At[t],r=e.payload;r.guid=r.key+r.id;r.childGuid=r.key+r.childId;r.error&&(r.stack=r.error.stack);Ot.trigger(e.name,e.payload)}At.length=0},50)}function c(t,e,r){1===At.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:r&&r._id,label:e._label,timeStamp:Date.now(),error:Ot["instrument-with-stack"]?new Error(e._label):null}})&&s()}function a(t,e){var r=this;if(t&&"object"==typeof t&&t.constructor===r)return t;var n=new r(l,e);w(n,t);return n}function f(){return new TypeError("A promises callback cannot return that same promise.")}function l(){}function h(){this.error=null}function p(t){try{return t.then}catch(e){Rt.error=e;return Rt}}function y(){try{var t=kt;kt=null;return t.apply(this,arguments)}catch(e){xt.error=e;return xt}}function _(t){kt=t;return y}function d(t,e,r,n){try{t.call(e,r,n)}catch(o){return o}}function v(t,e,r){Ot.async(function(t){var n=!1,o=d(r,e,function(r){if(!n){n=!0;e!==r?w(t,r,void 0):j(t,r)}},function(e){if(!n){n=!0;E(t,e)}},"Settle: "+(t._label||" unknown promise"));if(!n&&o){n=!0;E(t,o)}},t)}function b(t,e){if(e._state===Pt)j(t,e._result);else if(e._state===St){e._onError=null;E(t,e._result)}else O(e,void 0,function(r){e===r?j(t,r):w(t,r)},function(e){return E(t,e)})}function m(t,e,r){var n=e.constructor===t.constructor&&r===S&&t.constructor.resolve===a;if(n)b(t,e);else if(r===Rt){var i=Rt.error;Rt.error=null;E(t,i)}else o(r)?v(t,e,r):j(t,e)}function w(t,e){t===e?j(t,e):n(e)?m(t,e,p(e)):j(t,e)}function g(t){t._onError&&t._onError(t._result);A(t)}function j(t,e){if(t._state===Tt){t._result=e;t._state=Pt;0===t._subscribers.length?Ot.instrument&&c("fulfilled",t):Ot.async(A,t)}}function E(t,e){if(t._state===Tt){t._state=St;t._result=e;Ot.async(g,t)}}function O(t,e,r,n){var o=t._subscribers,i=o.length;t._onError=null;o[i]=e;o[i+Pt]=r;o[i+St]=n;0===i&&t._state&&Ot.async(A,t)}function A(t){var e=t._subscribers,r=t._state;Ot.instrument&&c(r===Pt?"fulfilled":"rejected",t);if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,u=0;u<e.length;u+=3){n=e[u];o=e[u+r];n?T(r,n,o,i):o(i)}t._subscribers.length=0}}function T(t,e,r,n){var i=o(r),u=void 0;u=i?_(r)(n):n;if(e._state!==Tt);else if(u===e)E(e,f());else if(u===xt){var s=u.error;u.error=null;E(e,s)}else i?w(e,u):t===Pt?j(e,u):t===St&&E(e,u)}function P(t,e){var r=!1;try{e(function(e){if(!r){r=!0;w(t,e)}},function(e){if(!r){r=!0;E(t,e)}})}catch(n){E(t,n)}}function S(t,e,r){var n=this,o=n._state;if(o===Pt&&!t||o===St&&!e){Ot.instrument&&c("chained",n,n);return n}n._onError=null;var i=new n.constructor(l,r),u=n._result;Ot.instrument&&c("chained",n,i);if(o===Tt)O(n,i,t,e);else{var s=o===Pt?t:e;Ot.async(function(){return T(o,i,s,u)})}return i}function R(t,e,r){this._remaining--;t===Pt?this._result[e]={state:"fulfilled",value:r}:this._result[e]={state:"rejected",reason:r}}function x(t,e){return Array.isArray(t)?new Mt(this,t,(!0),e).promise:this.reject(new TypeError("Promise.all must be called with an array"),e)}function k(t,e){var r=this,n=new r(l,e);if(!Array.isArray(t)){E(n,new TypeError("Promise.race must be called with an array"));return n}for(var o=0;n._state===Tt&&o<t.length;o++)O(r.resolve(t[o]),void 0,function(t){return w(n,t)},function(t){return E(n,t)});return n}function M(t,e){var r=this,n=new r(l,e);E(n,t);return n}function C(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function F(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function I(){this.value=void 0}function N(t){try{return t.then}catch(e){Nt.value=e;return Nt}}function V(t,e,r){try{t.apply(e,r)}catch(n){Nt.value=n;return Nt}}function U(t,e){for(var r={},n=t.length,o=new Array(n),i=0;i<n;i++)o[i]=t[i];for(var u=0;u<e.length;u++){var s=e[u];r[s]=o[u+1]}return r}function D(t){for(var e=t.length,r=new Array(e-1),n=1;n<e;n++)r[n-1]=t[n];return r}function K(t,e){return{then:function(r,n){return t.call(e,r,n)}}}function q(t,e){var r=function(){for(var r=this,n=arguments.length,o=new Array(n+1),i=!1,u=0;u<n;++u){var s=arguments[u];if(!i){i=W(s);if(i===Vt){var c=new It(l);E(c,Vt.value);return c}i&&i!==!0&&(s=K(i,s))}o[u]=s}var a=new It(l);o[n]=function(t,r){t?E(a,t):void 0===e?w(a,r):e===!0?w(a,D(arguments)):Array.isArray(e)?w(a,U(arguments,e)):w(a,r)};return i?L(a,o,t,r):G(a,o,t,r)};r.__proto__=t;return r}function G(t,e,r,n){var o=V(r,n,e);o===Nt&&E(t,o.value);return t}function L(t,e,r,n){return It.all(e).then(function(e){var o=V(r,n,e);o===Nt&&E(t,o.value);return t})}function W(t){return!(!t||"object"!=typeof t)&&(t.constructor===It||N(t))}function Y(t,e){return It.all(t,e)}function $(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function z(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function B(t,e){return Array.isArray(t)?new Ut(It,t,e).promise:It.reject(new TypeError("Promise.allSettled must be called with an array"),e)}function H(t,e){return It.race(t,e)}function J(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function Q(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function X(t,e){return i(t)?new Kt(It,t,e).promise:It.reject(new TypeError("Promise.hash must be called with an object"),e)}function Z(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function tt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function et(t,e){return i(t)?new qt(It,t,(!1),e).promise:It.reject(new TypeError("RSVP.hashSettled must be called with an object"),e)}function rt(t){setTimeout(function(){throw t});throw t}function nt(t){var e={resolve:void 0,reject:void 0};e.promise=new It(function(t,r){e.resolve=t;e.reject=r},t);return e}function ot(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function it(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function ut(t,e,r){return Array.isArray(t)?o(e)?new Gt(It,t,e,r).promise:It.reject(new TypeError("RSVP.map expects a function as a second argument"),r):It.reject(new TypeError("RSVP.map must be called with an array"),r)}function st(t,e){return It.resolve(t,e)}function ct(t,e){return It.reject(t,e)}function at(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function ft(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function lt(t,e,r){return Array.isArray(t)||i(t)&&void 0!==t.then?o(e)?It.resolve(t,r).then(function(t){return new Wt(It,t,e,r).promise}):It.reject(new TypeError("RSVP.filter expects function as a second argument"),r):It.reject(new TypeError("RSVP.filter must be called with an array or promise"),r)}function ht(t,e){Xt[Yt]=t;Xt[Yt+1]=e;Yt+=2;2===Yt&&Zt()}function pt(){var t=process.nextTick,e=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate);return function(){return t(bt)}}function yt(){return"undefined"!=typeof $t?function(){$t(bt)}:vt()}function _t(){var t=0,e=new Ht(bt),r=document.createTextNode("");e.observe(r,{characterData:!0});return function(){return r.data=t=++t%2}}function dt(){var t=new MessageChannel;t.port1.onmessage=bt;return function(){return t.port2.postMessage(0)}}function vt(){return function(){return setTimeout(bt,1)}}function bt(){for(var t=0;t<Yt;t+=2){var e=Xt[t],r=Xt[t+1];e(r);Xt[t]=void 0;Xt[t+1]=void 0}Yt=0}function mt(){try{var t=require,e=t("vertx");$t=e.runOnLoop||e.runOnContext;return yt()}catch(r){return vt()}}function wt(t,e,r){e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r;return t}function gt(){Ot.on.apply(Ot,arguments)}function jt(){Ot.off.apply(Ot,arguments)}var Et={mixin:function(t){t.on=this.on;t.off=this.off;t.trigger=this.trigger;t._promiseCallbacks=void 0;return t},on:function(t,r){if("function"!=typeof r)throw new TypeError("Callback must be a function");var n=e(this),o=void 0;o=n[t];o||(o=n[t]=[]);o.indexOf(r)&&o.push(r)},off:function(t,r){var n=e(this),o=void 0,i=void 0;if(r){o=n[t];i=o.indexOf(r);i!==-1&&o.splice(i,1)}else n[t]=[]},trigger:function(t,r,n){var o=e(this),i=void 0,u=void 0;if(i=o[t])for(var s=0;s<i.length;s++){u=i[s];u(r,n)}}},Ot={instrument:!1};Et.mixin(Ot);var At=[],Tt=void 0,Pt=1,St=2,Rt=new h,xt=new h,kt=void 0,Mt=function(){function t(t,e,r,n){this._instanceConstructor=t;this.promise=new t(l,n);this._abortOnReject=r;this.isUsingOwnPromise=t===It;this._init.apply(this,arguments)}t.prototype._init=function(t,e){var r=e.length||0;this.length=r;this._remaining=r;this._result=new Array(r);this._enumerate(e)};t.prototype._enumerate=function(t){for(var e=this.length,r=this.promise,n=0;r._state===Tt&&n<e;n++)this._eachEntry(t[n],n,!0);this._checkFullfillment()};t.prototype._checkFullfillment=function(){0===this._remaining&&j(this.promise,this._result)};t.prototype._settleMaybeThenable=function(t,e,r){var n=this._instanceConstructor,o=n.resolve;if(o===a){var i=p(t);if(i===S&&t._state!==Tt){t._onError=null;this._settledAt(t._state,e,t._result,r)}else if("function"!=typeof i)this._settledAt(Pt,e,t,r);else if(this.isUsingOwnPromise){var u=new n(l);m(u,t,i);this._willSettleAt(u,e,r)}else this._willSettleAt(new n(function(e){return e(t)}),e,r)}else this._willSettleAt(o(t),e,r)};t.prototype._eachEntry=function(t,e,r){u(t)?this._settleMaybeThenable(t,e,r):this._setResultAt(Pt,e,t,r)};t.prototype._settledAt=function(t,e,r,n){var o=this.promise;if(o._state===Tt)if(this._abortOnReject&&t===St)E(o,r);else{this._setResultAt(t,e,r,n);this._checkFullfillment()}};t.prototype._setResultAt=function(t,e,r,n){this._remaining--;this._result[e]=r};t.prototype._willSettleAt=function(t,e,r){var n=this;O(t,void 0,function(t){return n._settledAt(Pt,e,t,r)},function(t){return n._settledAt(St,e,t,r)})};return t}(),Ct="rsvp_"+Date.now()+"-",Ft=0,It=function(){function t(e,r){this._id=Ft++;this._label=r;this._state=void 0;this._result=void 0;this._subscribers=[];Ot.instrument&&c("created",this);if(l!==e){"function"!=typeof e&&C();this instanceof t?P(this,e):F()}}t.prototype._onError=function(t){var e=this;Ot.after(function(){e._onError&&Ot.trigger("error",t,e._label)})};t.prototype["catch"]=function(t,e){return this.then(void 0,t,e)};t.prototype["finally"]=function(t,e){var r=this,n=r.constructor;return r.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){throw e})},e)};return t}();It.cast=a;It.all=x;It.race=k;It.resolve=a;It.reject=M;It.prototype._guidKey=Ct;It.prototype.then=S;var Nt=new I,Vt=new I,Ut=function(t){function e(e,r,n){return $(this,t.call(this,e,r,!1,n))}z(e,t);return e}(Mt);Ut.prototype._setResultAt=R;var Dt=Object.prototype.hasOwnProperty,Kt=function(t){function e(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments[3];return J(this,t.call(this,e,r,n,o))}Q(e,t);e.prototype._init=function(t,e){this._result={};this._enumerate(e);0===this._remaining&&j(this.promise,this._result)};e.prototype._enumerate=function(t){var e=this.promise,r=[];for(var n in t)Dt.call(t,n)&&r.push({position:n,entry:t[n]});var o=r.length;this._remaining=o;for(var i=void 0,u=0;e._state===Tt&&u<o;u++){i=r[u];this._eachEntry(i.entry,i.position)}};return e}(Mt),qt=function(t){function e(e,r,n){return Z(this,t.call(this,e,r,!1,n))}tt(e,t);return e}(Kt);qt.prototype._setResultAt=R;var Gt=function(t){function e(e,r,n,o){return ot(this,t.call(this,e,r,!0,o,n))}it(e,t);e.prototype._init=function(t,e,r,n,o){var i=e.length||0;this.length=i;this._remaining=i;this._result=new Array(i);this._mapFn=o;this._enumerate(e)};e.prototype._setResultAt=function(t,e,r,n){if(n){var o=_(this._mapFn)(r,e);o===xt?this._settledAt(St,e,o.error,!1):this._eachEntry(o,e,!1)}else{this._remaining--;this._result[e]=r}};return e}(Mt),Lt={},Wt=function(t){function e(e,r,n,o){return at(this,t.call(this,e,r,!0,o,n))}ft(e,t);e.prototype._init=function(t,e,r,n,o){var i=e.length||0;this.length=i;this._remaining=i;this._result=new Array(i);this._filterFn=o;this._enumerate(e)};e.prototype._checkFullfillment=function(){if(0===this._remaining){this._result=this._result.filter(function(t){return t!==Lt});j(this.promise,this._result)}};e.prototype._setResultAt=function(t,e,r,n){if(n){this._result[e]=r;var o=_(this._filterFn)(r,e);o===xt?this._settledAt(St,e,o.error,!1):this._eachEntry(o,e,!1)}else{this._remaining--;r||(this._result[e]=Lt)}};return e}(Mt),Yt=0,$t=void 0,zt="undefined"!=typeof window?window:void 0,Bt=zt||{},Ht=Bt.MutationObserver||Bt.WebKitMutationObserver,Jt="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),Qt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,Xt=new Array(1e3),Zt=void 0;Zt=Jt?pt():Ht?_t():Qt?dt():void 0===zt&&"function"==typeof require?mt():vt();var te=void 0;if("object"==typeof self)te=self;else{if("object"!=typeof global)throw new Error("no global: `self` or `global` found");te=global}var ee;Ot.async=ht;Ot.after=function(t){return setTimeout(t,0)};var re=st,ne=function(t,e){return Ot.async(t,e)};if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var oe=window.__PROMISE_INSTRUMENTATION__;r("instrument",!0);for(var ie in oe)oe.hasOwnProperty(ie)&&gt(ie,oe[ie])}var ue=(ee={asap:ht,cast:re,Promise:It,EventTarget:Et,all:Y,allSettled:B,race:H,hash:X,hashSettled:et,rethrow:rt,defer:nt,denodeify:q,configure:r,on:gt,off:jt,resolve:st,reject:ct,map:ut},wt(ee,"async",ne),wt(ee,"filter",lt),ee);t["default"]=ue;t.asap=ht;t.cast=re;t.Promise=It;t.EventTarget=Et;t.all=Y;t.allSettled=B;t.race=H;t.hash=X;t.hashSettled=et;t.rethrow=rt;t.defer=nt;t.denodeify=q;t.configure=r;t.on=gt;t.off=jt;t.resolve=st;t.reject=ct;t.map=ut;t.async=ne;t.filter=lt;Object.defineProperty(t,"__esModule",{value:!0})});

@@ -97,6 +97,6 @@ import {

subscribe(thenable, undefined, value => {
if (thenable !== value) {
resolve(promise, value, undefined);
if (thenable === value) {
fulfill(promise, value);
} else {
fulfill(promise, value);
resolve(promise, value);
}

@@ -116,4 +116,5 @@ }, reason => reject(promise, reason));

} else if (then === GET_THEN_ERROR) {
reject(promise, GET_THEN_ERROR.error);
let error = GET_THEN_ERROR.error
GET_THEN_ERROR.error = null;
reject(promise, error);
} else if (isFunction(then)) {

@@ -209,14 +210,6 @@ handleForeignThenable(promise, maybeThenable, then);

let hasCallback = isFunction(callback);
let value, error;
let value;
if (hasCallback) {
value = tryCatch(callback)(result);
if (value === TRY_CATCH_ERROR) {
error = value.error;
value.error = null; // release
} else if (value === promise) {
reject(promise, withOwnPromise());
return;
}
} else {

@@ -228,6 +221,10 @@ value = result;

// noop
} else if (hasCallback && error === undefined) {
} else if (value === promise) {
reject(promise, withOwnPromise());
} else if (value === TRY_CATCH_ERROR) {
let error = value.error;
value.error = null; // release
reject(promise, error);
} else if (hasCallback) {
resolve(promise, value);
} else if (error !== undefined) {
reject(promise, error);
} else if (state === FULFILLED) {

@@ -234,0 +231,0 @@ fulfill(promise, value);

{
"name": "rsvp",
"namespace": "RSVP",
"version": "4.0.1",
"version": "4.0.2",
"description": "A lightweight library that provides tools for organizing asynchronous code",

@@ -6,0 +6,0 @@ "main": "dist/rsvp.js",

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 too big to display

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc