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

typescript-deferred

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-deferred - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

bower.json
{
"name": "typescript-deferred",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/DirtyHairy/typescript-deferred",

@@ -5,0 +5,0 @@ "authors": [

@@ -15,3 +15,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.typescriptDeferred = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

function DispatchDeferred(closure) {
setTimeout(function () { return closure(); }, 0);
setTimeout(closure, 0);
}

@@ -18,0 +18,0 @@ var PromiseState;

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

!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.typescriptDeferred=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(){return new i(f)}function e(a){return a instanceof j?a:d().resolve(a).promise}function f(a){setTimeout(function(){return a()},0)}c.create=d,c.when=e;var g;!function(a){a[a.Pending=0]="Pending",a[a.ResolutionInProgress=1]="ResolutionInProgress",a[a.Resolved=2]="Resolved",a[a.Rejected=3]="Rejected"}(g||(g={}));var h=function(){function a(a,b,c){this._dispatcher=a,this._successCB=b,this._errorCB=c,this.result=new i(a)}return a.prototype.resolve=function(a,b){var c=this;return"function"!=typeof this._successCB?void this.result.resolve(a):void(b?this._dispatcher(function(){return c._dispatchCallback(c._successCB,a)}):this._dispatchCallback(this._successCB,a))},a.prototype.reject=function(a,b){var c=this;return"function"!=typeof this._errorCB?void this.result.reject(a):void(b?this._dispatcher(function(){return c._dispatchCallback(c._errorCB,a)}):this._dispatchCallback(this._errorCB,a))},a.prototype._dispatchCallback=function(a,b){var c;try{c=a(b),this.result.resolve(c)}catch(d){return void this.result.reject(d)}},a}(),i=function(){function a(a){this._dispatcher=a,this._stack=[],this._state=0,this.promise=new j(this)}return a.prototype._then=function(a,b){if("function"!=typeof a&&"function"!=typeof b)return this.promise;var c=new h(this._dispatcher,a,b);switch(this._state){case 0:case 1:this._stack.push(c);break;case 2:c.resolve(this._value,!0);break;case 3:c.reject(this._error,!0)}return c.result.promise},a.prototype.resolve=function(a){var b=this;if(0!==this._state)return this;var c,d=typeof a,e=!0;try{if(null===a||"object"!==d&&"function"!==d||"function"!=typeof(c=a.then))this._state=1,this._dispatcher(function(){b._state=2,b._value=a;var c,d=b._stack.length;for(c=0;d>c;c++)b._stack[c].resolve(a,!1);b._stack.splice(0,d)});else{if(a===this.promise)throw new TypeError("recursive resolution");this._state=1,c.call(a,function(a){e&&(e=!1,b._state=0,b.resolve(a))},function(a){e&&(e=!1,b._state=1,b.reject(a))})}}catch(f){e&&this.reject(f)}return this},a.prototype.reject=function(a){var b=this;return this._state=1,this._dispatcher(function(){b._state=3,b._error=a;var c=b._stack.length,d=0;for(d=0;c>d;d++)b._stack[d].reject(a,!1);b._stack.splice(0,c)}),this},a}(),j=function(){function a(a){this._deferred=a}return a.prototype.then=function(a,b){return this._deferred._then(a,b)},a.prototype.otherwise=function(a){return this._deferred._then(void 0,a)},a.prototype.always=function(a){return this._deferred._then(a,a)},a}()},{}]},{},[1])(1)});
!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.typescriptDeferred=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";function d(){return new i(f)}function e(a){return a instanceof j?a:d().resolve(a).promise}function f(a){setTimeout(a,0)}c.create=d,c.when=e;var g;!function(a){a[a.Pending=0]="Pending",a[a.ResolutionInProgress=1]="ResolutionInProgress",a[a.Resolved=2]="Resolved",a[a.Rejected=3]="Rejected"}(g||(g={}));var h=function(){function a(a,b,c){this._dispatcher=a,this._successCB=b,this._errorCB=c,this.result=new i(a)}return a.prototype.resolve=function(a,b){var c=this;return"function"!=typeof this._successCB?void this.result.resolve(a):void(b?this._dispatcher(function(){return c._dispatchCallback(c._successCB,a)}):this._dispatchCallback(this._successCB,a))},a.prototype.reject=function(a,b){var c=this;return"function"!=typeof this._errorCB?void this.result.reject(a):void(b?this._dispatcher(function(){return c._dispatchCallback(c._errorCB,a)}):this._dispatchCallback(this._errorCB,a))},a.prototype._dispatchCallback=function(a,b){var c;try{c=a(b),this.result.resolve(c)}catch(d){return void this.result.reject(d)}},a}(),i=function(){function a(a){this._dispatcher=a,this._stack=[],this._state=0,this.promise=new j(this)}return a.prototype._then=function(a,b){if("function"!=typeof a&&"function"!=typeof b)return this.promise;var c=new h(this._dispatcher,a,b);switch(this._state){case 0:case 1:this._stack.push(c);break;case 2:c.resolve(this._value,!0);break;case 3:c.reject(this._error,!0)}return c.result.promise},a.prototype.resolve=function(a){var b=this;if(0!==this._state)return this;var c,d=typeof a,e=!0;try{if(null===a||"object"!==d&&"function"!==d||"function"!=typeof(c=a.then))this._state=1,this._dispatcher(function(){b._state=2,b._value=a;var c,d=b._stack.length;for(c=0;d>c;c++)b._stack[c].resolve(a,!1);b._stack.splice(0,d)});else{if(a===this.promise)throw new TypeError("recursive resolution");this._state=1,c.call(a,function(a){e&&(e=!1,b._state=0,b.resolve(a))},function(a){e&&(e=!1,b._state=1,b.reject(a))})}}catch(f){e&&this.reject(f)}return this},a.prototype.reject=function(a){var b=this;return this._state=1,this._dispatcher(function(){b._state=3,b._error=a;var c=b._stack.length,d=0;for(d=0;c>d;d++)b._stack[d].reject(a,!1);b._stack.splice(0,c)}),this},a}(),j=function(){function a(a){this._deferred=a}return a.prototype.then=function(a,b){return this._deferred._then(a,b)},a.prototype.otherwise=function(a){return this._deferred._then(void 0,a)},a.prototype.always=function(a){return this._deferred._then(a,a)},a}()},{}]},{},[1])(1)});
{
"name": "typescript-deferred",
"version": "0.1.2",
"version": "0.1.3",
"description": "A tiny Promises/A+ promise implementation written in Typescript",

@@ -5,0 +5,0 @@ "keywords": ["promise", "deferred", "typescript"],

@@ -14,3 +14,3 @@ 'use strict';

function DispatchDeferred(closure) {
setTimeout(function () { return closure(); }, 0);
setTimeout(closure, 0);
}

@@ -17,0 +17,0 @@ var PromiseState;

@@ -126,3 +126,3 @@ /**

function DispatchDeferred(closure: () => void) {
setTimeout(() => closure(), 0);
setTimeout(closure, 0);
}

@@ -129,0 +129,0 @@

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