atomic-promise
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,2 +0,2 @@ | ||
/*! atomic-promise v0.0.11 https://github.com/falsandtru/atomic-promise | (c) 2018, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
/*! atomic-promise v0.0.12 https://github.com/falsandtru/atomic-promise | (c) 2018, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
require = function () { | ||
@@ -456,3 +456,3 @@ function r(e, n, t) { | ||
} else { | ||
root.returnExports = factory(); | ||
root.commonJsStrict = factory(); | ||
} | ||
@@ -459,0 +459,0 @@ }(typeof self !== 'undefined' ? self : this, function () { |
@@ -1,2 +0,2 @@ | ||
/*! atomic-promise v0.0.11 https://github.com/falsandtru/atomic-promise | (c) 2018, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
require=function(){return function e(t,r,s){function n(o,a){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){return n(t[o][1][e]||e)},l,l.exports,e,t,r,s)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}}()({1:[function(e,t,r){},{}],2:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isArray=r.ObjectValues=r.ObjectSetPrototypeOf=r.ObjectSeal=r.ObjectPreventExtensions=r.ObjectKeys=r.isSealed=r.isFrozen=r.isExtensible=r.ObjectIs=r.ObjectGetPrototypeOf=r.ObjectGetOwnPropertySymbols=r.ObjectGetOwnPropertyNames=r.ObjectGetOwnPropertyDescriptors=r.ObjectGetOwnPropertyDescriptor=r.ObjectFromEntries=r.ObjectFreeze=r.ObjectEntries=r.ObjectDefineProperty=r.ObjectDefineProperties=r.ObjectCreate=r.ObjectAssign=r.toString=r.isEnumerable=r.isPrototypeOf=r.hasOwnProperty=r.SymbolKeyFor=r.SymbolFor=r.sign=r.round=r.random=r.min=r.max=r.floor=r.ceil=r.abs=r.parseInt=r.parseFloat=r.isSafeInteger=r.isNaN=r.isInteger=r.isFinite=r.NaN=void 0,r.NaN=Number.NaN,r.isFinite=Number.isFinite,r.isInteger=Number.isInteger,r.isNaN=Number.isNaN,r.isSafeInteger=Number.isSafeInteger,r.parseFloat=Number.parseFloat,r.parseInt=Number.parseInt,r.abs=Math.abs,r.ceil=Math.ceil,r.floor=Math.floor,r.max=Math.max,r.min=Math.min,r.random=Math.random,r.round=Math.round,r.sign=Math.sign,r.SymbolFor=Symbol.for,r.SymbolKeyFor=Symbol.keyFor,r.hasOwnProperty=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty),r.isPrototypeOf=Object.prototype.isPrototypeOf.call.bind(Object.prototype.isPrototypeOf),r.isEnumerable=Object.prototype.propertyIsEnumerable.call.bind(Object.prototype.propertyIsEnumerable),r.toString=Object.prototype.toString.call.bind(Object.prototype.toString),r.ObjectAssign=Object.assign,r.ObjectCreate=Object.create,r.ObjectDefineProperties=Object.defineProperties,r.ObjectDefineProperty=Object.defineProperty,r.ObjectEntries=Object.entries,r.ObjectFreeze=Object.freeze,r.ObjectFromEntries=Object.fromEntries,r.ObjectGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,r.ObjectGetOwnPropertyDescriptors=Object.getOwnPropertyDescriptors,r.ObjectGetOwnPropertyNames=Object.getOwnPropertyNames,r.ObjectGetOwnPropertySymbols=Object.getOwnPropertySymbols,r.ObjectGetPrototypeOf=Object.getPrototypeOf,r.ObjectIs=Object.is,r.isExtensible=Object.isExtensible,r.isFrozen=Object.isFrozen,r.isSealed=Object.isSealed,r.ObjectKeys=Object.keys,r.ObjectPreventExtensions=Object.preventExtensions,r.ObjectSeal=Object.seal,r.ObjectSetPrototypeOf=Object.setPrototypeOf,r.ObjectValues=Object.values,r.isArray=Array.isArray},{}],4:[function(_dereq_,module,exports){"use strict";const global="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||Function("return this")();eval("global.global = global"),module.exports=global},{}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.noop=void 0,r.noop=function(){}},{}],6:[function(e,t,r){"use strict";var s,n;Object.defineProperty(r,"__esModule",{value:!0}),r.never=r.isPromiseLike=r.Internal=r.AtomicPromise=void 0;const i=e("./global"),o=e("./alias"),a=e("./noop"),c=Symbol.for("spica/promise::internal");class u{constructor(e){this[s]="Promise",this[n]=new l;try{e(e=>void this[c].resolve(e),e=>void this[c].reject(e))}catch(e){this[c].reject(e)}}static get[Symbol.species](){return u}static all(e){return new u((t,r)=>{const s=(0,o.isArray)(e)?e:[...e],n=(0,i.Array)(s.length);let a=0;for(let e=0;e<s.length;++e){const i=s[e];if(p(i)){if(h(i)){const{status:t}=i[c];switch(t.state){case 2:n[e]=t.value,++a;continue;case 3:r(t.reason),e=s.length;continue}}i.then(r=>{n[e]=r,++a===s.length&&t(n)},t=>{r(t),e=s.length})}else n[e]=i,++a}a===s.length&&t(n)})}static race(e){return new u((t,r)=>{const s=(0,o.isArray)(e)?e:[...e];for(let e=0;e<s.length;++e){const n=s[e];if(!p(n))return t(n);if(h(n)){const{status:e}=n[c];switch(e.state){case 2:return t(e.value);case 3:return r(e.reason)}}}let n=!1;for(let e=0;e<s.length;++e){if(s[e].then(e=>{t(e),n=!0},e=>{r(e),n=!0}),n)return}})}static allSettled(e){return new u(t=>{const r=(0,o.isArray)(e)?e:[...e],s=(0,i.Array)(r.length);let n=0;for(let e=0;e<r.length;++e){const i=r[e];if(p(i)){if(h(i)){const{status:t}=i[c];switch(t.state){case 2:s[e]={status:"fulfilled",value:t.value},++n;continue;case 3:s[e]={status:"rejected",reason:t.reason},++n;continue}}i.then(i=>{s[e]={status:"fulfilled",value:i},++n===r.length&&t(s)},i=>{s[e]={status:"rejected",reason:i},++n===r.length&&t(s)})}else s[e]={status:"fulfilled",value:i},++n}n===r.length&&t(s)})}static resolve(e){return new u(t=>t(e))}static reject(e){return new u((t,r)=>r(e))}then(e,t){return new u((r,s)=>this[c].then(r,s,e,t))}catch(e){return this.then(void 0,e)}finally(e){return this.then(e,e).then(()=>this)}}r.AtomicPromise=u,s=Symbol.toStringTag,n=c;class l{constructor(){this.status={state:0},this.fulfillReactions=[],this.rejectReactions=[]}get isPending(){return 0===this.status.state}resolve(e){if(0===this.status.state){if(!p(e))return this.status={state:2,value:e},this.resume();if(h(e)){const t=e[c];switch(t.status.state){case 2:case 3:return this.status=t.status,this.resume();default:return t.then(()=>(this.status=t.status,this.resume()),()=>(this.status=t.status,this.resume()))}}this.status={state:1,promise:e},e.then(e=>{this.status={state:2,value:e},this.resume()},e=>{this.status={state:3,reason:e},this.resume()})}}reject(e){if(0===this.status.state)return this.status={state:3,reason:e},this.resume()}then(e,t,r,s){const{status:n,fulfillReactions:i,rejectReactions:o}=this;switch(n.state){case 2:if(0!==i.length)break;return b(e,t,e,r,n.value);case 3:if(0!==o.length)break;return b(e,t,t,s,n.reason)}i.push([e,t,e,r]),o.push([e,t,t,s])}resume(){const{status:e,fulfillReactions:t,rejectReactions:r}=this;switch(e.state){case 0:case 1:return;case 2:if(0!==r.length&&(this.rejectReactions=[]),0===t.length)return;return f(t,e.value),void(this.fulfillReactions=[]);case 3:if(0!==t.length&&(this.fulfillReactions=[]),0===r.length)return;return f(r,e.reason),void(this.rejectReactions=[])}}}function f(e,t){for(let r=0;r<e.length;++r){const s=e[r];b(s[0],s[1],s[2],s[3],t)}}function b(e,t,r,s,n){if(!s)return r(n);try{e(s(n))}catch(e){t(e)}}function p(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}function h(e){return c in e}r.Internal=l,r.isPromiseLike=p,r.never=new class e extends Promise{static get[Symbol.species](){return e}constructor(){super(a.noop)}then(){return this}catch(){return this}finally(){return this}}},{"./alias":3,"./global":4,"./noop":5}],"atomic-promise":[function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),n(e("spica/promise"),r)},{"spica/promise":6}]},{},[1,2,"atomic-promise"]),function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&module.exports?module.exports=t():e.returnExports=t()}("undefined"!=typeof self?self:this,function(){return require("atomic-promise")}); | ||
/*! atomic-promise v0.0.12 https://github.com/falsandtru/atomic-promise | (c) 2018, falsandtru | (Apache-2.0 AND MPL-2.0) License */ | ||
require=function(){return function e(t,r,s){function n(o,a){if(!r[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(i)return i(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[o]={exports:{}};t[o][0].call(l.exports,function(e){return n(t[o][1][e]||e)},l,l.exports,e,t,r,s)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<s.length;o++)n(s[o]);return n}}()({1:[function(e,t,r){},{}],2:[function(e,t,r){arguments[4][1][0].apply(r,arguments)},{dup:1}],3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isArray=r.ObjectValues=r.ObjectSetPrototypeOf=r.ObjectSeal=r.ObjectPreventExtensions=r.ObjectKeys=r.isSealed=r.isFrozen=r.isExtensible=r.ObjectIs=r.ObjectGetPrototypeOf=r.ObjectGetOwnPropertySymbols=r.ObjectGetOwnPropertyNames=r.ObjectGetOwnPropertyDescriptors=r.ObjectGetOwnPropertyDescriptor=r.ObjectFromEntries=r.ObjectFreeze=r.ObjectEntries=r.ObjectDefineProperty=r.ObjectDefineProperties=r.ObjectCreate=r.ObjectAssign=r.toString=r.isEnumerable=r.isPrototypeOf=r.hasOwnProperty=r.SymbolKeyFor=r.SymbolFor=r.sign=r.round=r.random=r.min=r.max=r.floor=r.ceil=r.abs=r.parseInt=r.parseFloat=r.isSafeInteger=r.isNaN=r.isInteger=r.isFinite=r.NaN=void 0,r.NaN=Number.NaN,r.isFinite=Number.isFinite,r.isInteger=Number.isInteger,r.isNaN=Number.isNaN,r.isSafeInteger=Number.isSafeInteger,r.parseFloat=Number.parseFloat,r.parseInt=Number.parseInt,r.abs=Math.abs,r.ceil=Math.ceil,r.floor=Math.floor,r.max=Math.max,r.min=Math.min,r.random=Math.random,r.round=Math.round,r.sign=Math.sign,r.SymbolFor=Symbol.for,r.SymbolKeyFor=Symbol.keyFor,r.hasOwnProperty=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty),r.isPrototypeOf=Object.prototype.isPrototypeOf.call.bind(Object.prototype.isPrototypeOf),r.isEnumerable=Object.prototype.propertyIsEnumerable.call.bind(Object.prototype.propertyIsEnumerable),r.toString=Object.prototype.toString.call.bind(Object.prototype.toString),r.ObjectAssign=Object.assign,r.ObjectCreate=Object.create,r.ObjectDefineProperties=Object.defineProperties,r.ObjectDefineProperty=Object.defineProperty,r.ObjectEntries=Object.entries,r.ObjectFreeze=Object.freeze,r.ObjectFromEntries=Object.fromEntries,r.ObjectGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,r.ObjectGetOwnPropertyDescriptors=Object.getOwnPropertyDescriptors,r.ObjectGetOwnPropertyNames=Object.getOwnPropertyNames,r.ObjectGetOwnPropertySymbols=Object.getOwnPropertySymbols,r.ObjectGetPrototypeOf=Object.getPrototypeOf,r.ObjectIs=Object.is,r.isExtensible=Object.isExtensible,r.isFrozen=Object.isFrozen,r.isSealed=Object.isSealed,r.ObjectKeys=Object.keys,r.ObjectPreventExtensions=Object.preventExtensions,r.ObjectSeal=Object.seal,r.ObjectSetPrototypeOf=Object.setPrototypeOf,r.ObjectValues=Object.values,r.isArray=Array.isArray},{}],4:[function(_dereq_,module,exports){"use strict";const global="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||Function("return this")();eval("global.global = global"),module.exports=global},{}],5:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.noop=void 0,r.noop=function(){}},{}],6:[function(e,t,r){"use strict";var s,n;Object.defineProperty(r,"__esModule",{value:!0}),r.never=r.isPromiseLike=r.Internal=r.AtomicPromise=void 0;const i=e("./global"),o=e("./alias"),a=e("./noop"),c=Symbol.for("spica/promise::internal");class u{constructor(e){this[s]="Promise",this[n]=new l;try{e(e=>void this[c].resolve(e),e=>void this[c].reject(e))}catch(e){this[c].reject(e)}}static get[Symbol.species](){return u}static all(e){return new u((t,r)=>{const s=(0,o.isArray)(e)?e:[...e],n=(0,i.Array)(s.length);let a=0;for(let e=0;e<s.length;++e){const i=s[e];if(p(i)){if(h(i)){const{status:t}=i[c];switch(t.state){case 2:n[e]=t.value,++a;continue;case 3:r(t.reason),e=s.length;continue}}i.then(r=>{n[e]=r,++a===s.length&&t(n)},t=>{r(t),e=s.length})}else n[e]=i,++a}a===s.length&&t(n)})}static race(e){return new u((t,r)=>{const s=(0,o.isArray)(e)?e:[...e];for(let e=0;e<s.length;++e){const n=s[e];if(!p(n))return t(n);if(h(n)){const{status:e}=n[c];switch(e.state){case 2:return t(e.value);case 3:return r(e.reason)}}}let n=!1;for(let e=0;e<s.length;++e){if(s[e].then(e=>{t(e),n=!0},e=>{r(e),n=!0}),n)return}})}static allSettled(e){return new u(t=>{const r=(0,o.isArray)(e)?e:[...e],s=(0,i.Array)(r.length);let n=0;for(let e=0;e<r.length;++e){const i=r[e];if(p(i)){if(h(i)){const{status:t}=i[c];switch(t.state){case 2:s[e]={status:"fulfilled",value:t.value},++n;continue;case 3:s[e]={status:"rejected",reason:t.reason},++n;continue}}i.then(i=>{s[e]={status:"fulfilled",value:i},++n===r.length&&t(s)},i=>{s[e]={status:"rejected",reason:i},++n===r.length&&t(s)})}else s[e]={status:"fulfilled",value:i},++n}n===r.length&&t(s)})}static resolve(e){return new u(t=>t(e))}static reject(e){return new u((t,r)=>r(e))}then(e,t){return new u((r,s)=>this[c].then(r,s,e,t))}catch(e){return this.then(void 0,e)}finally(e){return this.then(e,e).then(()=>this)}}r.AtomicPromise=u,s=Symbol.toStringTag,n=c;class l{constructor(){this.status={state:0},this.fulfillReactions=[],this.rejectReactions=[]}get isPending(){return 0===this.status.state}resolve(e){if(0===this.status.state){if(!p(e))return this.status={state:2,value:e},this.resume();if(h(e)){const t=e[c];switch(t.status.state){case 2:case 3:return this.status=t.status,this.resume();default:return t.then(()=>(this.status=t.status,this.resume()),()=>(this.status=t.status,this.resume()))}}this.status={state:1,promise:e},e.then(e=>{this.status={state:2,value:e},this.resume()},e=>{this.status={state:3,reason:e},this.resume()})}}reject(e){if(0===this.status.state)return this.status={state:3,reason:e},this.resume()}then(e,t,r,s){const{status:n,fulfillReactions:i,rejectReactions:o}=this;switch(n.state){case 2:if(0!==i.length)break;return b(e,t,e,r,n.value);case 3:if(0!==o.length)break;return b(e,t,t,s,n.reason)}i.push([e,t,e,r]),o.push([e,t,t,s])}resume(){const{status:e,fulfillReactions:t,rejectReactions:r}=this;switch(e.state){case 0:case 1:return;case 2:if(0!==r.length&&(this.rejectReactions=[]),0===t.length)return;return f(t,e.value),void(this.fulfillReactions=[]);case 3:if(0!==t.length&&(this.fulfillReactions=[]),0===r.length)return;return f(r,e.reason),void(this.rejectReactions=[])}}}function f(e,t){for(let r=0;r<e.length;++r){const s=e[r];b(s[0],s[1],s[2],s[3],t)}}function b(e,t,r,s,n){if(!s)return r(n);try{e(s(n))}catch(e){t(e)}}function p(e){return null!==e&&"object"==typeof e&&"function"==typeof e.then}function h(e){return c in e}r.Internal=l,r.isPromiseLike=p,r.never=new class e extends Promise{static get[Symbol.species](){return e}constructor(){super(a.noop)}then(){return this}catch(){return this}finally(){return this}}},{"./alias":3,"./global":4,"./noop":5}],"atomic-promise":[function(e,t,r){"use strict";var s=this&&this.__createBinding||(Object.create?function(e,t,r,s){void 0===s&&(s=r),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,s){void 0===s&&(s=r),e[s]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||s(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),n(e("spica/promise"),r)},{"spica/promise":6}]},{},[1,2,"atomic-promise"]),function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&module.exports?module.exports=t():e.commonJsStrict=t()}("undefined"!=typeof self?self:this,function(){return require("atomic-promise")}); |
@@ -52,3 +52,3 @@ const gulp = require('gulp'); | ||
} else { | ||
root.returnExports = factory(); | ||
root.commonJsStrict = factory(); | ||
} | ||
@@ -55,0 +55,0 @@ }(typeof self !== 'undefined' ? self : this, function () { |
{ | ||
"name": "atomic-promise", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Promise with no delay.", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is too big to display
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
468309