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

p-promise

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-promise - npm Package Compare versions

Comparing version 0.0.12 to 0.0.13

extra/reduce.js

22

p.js

@@ -164,6 +164,6 @@ ;(function( factory ){

function then( onFulfilled, onRejected, alt, altDef ) {
var def = alt === ALT ? altDef : defer();
function then( onFulfilled, onRejected, alt, sync ) {
var def = alt === ALT ? void 0 : defer();
function onReslved() {
function onSettled() {
var func = rejected ? onRejected : onFulfilled;

@@ -181,2 +181,3 @@

def.reject( ex );
return;
}

@@ -195,6 +196,9 @@

if ( pending ) {
pending.push( onReslved );
pending.push( onSettled );
} else if ( !def && sync ) {
onSettled();
} else {
runLater( onReslved );
runLater( onSettled );
}

@@ -208,3 +212,3 @@

if ( val instanceof Promise ) {
val.then( fulfill, reject, ALT );
val.then( fulfill, reject, ALT, true );

@@ -291,3 +295,3 @@ } else if ( val && typeof val.then === "function" ) {

def.reject( error );
}, ALT);
}, ALT, true);

@@ -351,2 +355,6 @@ return def.promise;

P.ALT = ALT;
P._each = each;
//P.runLater = runLater;

@@ -353,0 +361,0 @@

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

(function(e){if(typeof module!=="undefined"&&module&&module.exports){module.exports=e()}else if(typeof define==="function"&&define.amd){define(e)}else{P=e()}})(function(){"use strict";var e={f:null,w:false,n:null},n=e,t=true,r=0,o=0,i,f,u=m(typeof window)&&window||m(typeof worker)&&worker,c=e.toString,l,s={};function a(){--r;if(e.n){if(!r&&e.n.n){++r;f(a,0)}do{e=e.n;if(e.w){--o}var n=e.f;e.f=null;n()}while(e.n)}t=true}function p(e,i){if(t&&++o>r){++r;f(a,0)}n=n.n={f:e,w:t,n:null};t=i===true}function m(e){return e==="object"||e==="function"}function v(e){return e==="function"}if(m(typeof process)&&process&&v(typeof process.nextTick)){f=process.nextTick}else if(u&&v(typeof u.setImmediate)){f=function(e){u.setImmediate(e)}}else if(v(typeof MessageChannel)){i=new MessageChannel;i.port1.onmessage=a;f=function(){i.port2.postMessage(0)}}else{f=setTimeout;if(u&&m(typeof Image)&&Image){(function(){var e=0;var n=function(e){var n=new Image;n.onerror=e;n.src="data:image/png,"};try{n(function(){if(--e===0){f=n}});++e}catch(t){}e&&setTimeout(function(){e=0},0)})()}}l=Array.isArray||function(e){return!!e&&c.call(e)==="[object Array]"};function d(e,n){for(var t=0,r=e.length;t<r;++t){if(t in e){n(e[t],t)}}}function h(e,n){if(l(e)){d(e,n);return}for(var t in e){n(e[t],t)}}function y(e){if(e instanceof g){return e}var n=w();n.resolve(e);return n.promise}y.defer=w;function w(){var e=[],n=false,t=new g(o),r;function o(t,o,i,f){var u=i===s?f:w();function c(){var e=n?o:t;if(!u){e&&e(r);return}if(typeof e==="function"){try{var i=e(r)}catch(f){u.reject(f)}u.resolve(i)}else if(n){u.reject(r)}else{u.fulfill(r)}}if(e){e.push(c)}else{p(c)}return u&&u.promise}function i(n){if(e){if(n instanceof g){n.then(f,u,s)}else if(n&&typeof n.then==="function"){p(function(){try{n.then(f,u)}catch(e){u(e)}})}else{f(n)}}}function f(o){if(e){t.state=n?"rejected":"fulfilled";t.value=r=o;d(e,p);e=null}}function u(t){if(e){n=true;f(t)}}return{promise:t,resolve:i,fulfill:f,reject:u}}function g(e){this.then=e;this.state="pending";this.value=void 0}g.prototype.done=function(e,n){var t=this;if(e||n){t=t.then(e,n)}t.then(null,function(e){p(function(){if(y.onerror){y.onerror(e)}else{throw e}},true)},s)};g.prototype.spread=function(e,n){return this.then(e&&function(n){return e.apply(void 0,n)},n)};g.prototype.timeout=function(e){var n=w();var t=setTimeout(function(){n.reject(new Error("Timed out after "+e+" ms"))},e);this.when(function(e){clearTimeout(t);n.fulfill(e)},function(e){clearTimeout(t);n.reject(e)},s);return n.promise};g.prototype.delay=function(e){var n=this;var t=w();setTimeout(function(){t.resolve(n)},e);return t.promise};y.all=T;function T(e){var n=0;var t=w();h(e,function(r,o){++n;y(r).then(function(r){e[o]=r;if(--n===0){t.fulfill(e)}},t.reject,s)});if(n===0){t.fulfill(e)}return t.promise}y.allResolved=j;function j(e){var n=1;var t=w();function r(){if(--n===0){t.fulfill(e)}}h(e,function(t,o){++n;e[o]=t=y(t);t.then(r,r,s)});r();return t.promise}y.onerror=null;y.prototype=g.prototype;y.nextTick=function(e){p(e,true)};return y});
(function(e){if(typeof module!=="undefined"&&module&&module.exports){module.exports=e()}else if(typeof define==="function"&&define.amd){define(e)}else{P=e()}})(function(){"use strict";var e={f:null,w:false,n:null},n=e,t=true,r=0,o=0,i,f,u=v(typeof window)&&window||v(typeof worker)&&worker,c=e.toString,l,s={};function a(){--r;if(e.n){if(!r&&e.n.n){++r;f(a,0)}do{e=e.n;if(e.w){--o}var n=e.f;e.f=null;n()}while(e.n)}t=true}function p(e,i){if(t&&++o>r){++r;f(a,0)}n=n.n={f:e,w:t,n:null};t=i===true}function v(e){return e==="object"||e==="function"}function m(e){return e==="function"}if(v(typeof process)&&process&&m(typeof process.nextTick)){f=process.nextTick}else if(u&&m(typeof u.setImmediate)){f=function(e){u.setImmediate(e)}}else if(m(typeof MessageChannel)){i=new MessageChannel;i.port1.onmessage=a;f=function(){i.port2.postMessage(0)}}else{f=setTimeout;if(u&&v(typeof Image)&&Image){(function(){var e=0;var n=function(e){var n=new Image;n.onerror=e;n.src="data:image/png,"};try{n(function(){if(--e===0){f=n}});++e}catch(t){}e&&setTimeout(function(){e=0},0)})()}}l=Array.isArray||function(e){return!!e&&c.call(e)==="[object Array]"};function d(e,n){for(var t=0,r=e.length;t<r;++t){if(t in e){n(e[t],t)}}}function h(e,n){if(l(e)){d(e,n);return}for(var t in e){n(e[t],t)}}function y(e){if(e instanceof g){return e}var n=w();n.resolve(e);return n.promise}y.defer=w;function w(){var e=[],n=false,t=new g(o),r;function o(t,o,i,f){var u=i===s?void 0:w();function c(){var e=n?o:t;if(!u){e&&e(r);return}if(typeof e==="function"){try{var i=e(r)}catch(f){u.reject(f);return}u.resolve(i)}else if(n){u.reject(r)}else{u.fulfill(r)}}if(e){e.push(c)}else if(!u&&f){c()}else{p(c)}return u&&u.promise}function i(n){if(e){if(n instanceof g){n.then(f,u,s,true)}else if(n&&typeof n.then==="function"){p(function(){try{n.then(f,u)}catch(e){u(e)}})}else{f(n)}}}function f(o){if(e){t.state=n?"rejected":"fulfilled";t.value=r=o;d(e,p);e=null}}function u(t){if(e){n=true;f(t)}}return{promise:t,resolve:i,fulfill:f,reject:u}}function g(e){this.then=e;this.state="pending";this.value=void 0}g.prototype.done=function(e,n){var t=this;if(e||n){t=t.then(e,n)}t.then(null,function(e){p(function(){if(y.onerror){y.onerror(e)}else{throw e}},true)},s)};g.prototype.spread=function(e,n){return this.then(e&&function(n){return e.apply(void 0,n)},n)};g.prototype.timeout=function(e){var n=w();var t=setTimeout(function(){n.reject(new Error("Timed out after "+e+" ms"))},e);this.when(function(e){clearTimeout(t);n.fulfill(e)},function(e){clearTimeout(t);n.reject(e)},s,true);return n.promise};g.prototype.delay=function(e){var n=this;var t=w();setTimeout(function(){t.resolve(n)},e);return t.promise};y.all=T;function T(e){var n=0;var t=w();h(e,function(r,o){++n;y(r).then(function(r){e[o]=r;if(--n===0){t.fulfill(e)}},t.reject,s)});if(n===0){t.fulfill(e)}return t.promise}y.allResolved=j;function j(e){var n=1;var t=w();function r(){if(--n===0){t.fulfill(e)}}h(e,function(t,o){++n;e[o]=t=y(t);t.then(r,r,s)});r();return t.promise}y.onerror=null;y.prototype=g.prototype;y.nextTick=function(e){p(e,true)};y.ALT=s;y._each=h;return y});
{
"name": "p-promise",
"version": "0.0.12",
"version": "0.0.13",
"description": "A simple Promises/A+ library.",

@@ -5,0 +5,0 @@ "author": "Robert Katić <robert.katic@gmail.com> (https://github.com/rkatic)",

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