Socket
Socket
Sign inDemoInstall

oath

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.2.2

5

dist/oath.js

@@ -28,3 +28,3 @@ /*!

*/
exports.version = '0.2.1';
exports.version = '0.2.2';

@@ -79,5 +79,6 @@ /**

this.promise = {
then: function (success, failure) {
then: function (success, failure, progress) {
if (success) self._register('resolve', success);
if (failure) self._register('reject', failure);
if (progress) self._register('progress', progress);
if (self._oath.complete) self._traverse();

@@ -84,0 +85,0 @@ return this;

2

dist/oath.min.js

@@ -7,2 +7,2 @@ /*!

!function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&typeof define.amd=="object"?define(b):this[a]=b()}("oath",function(){function c(a){a=a||{},this._pending={},this._oath={complete:!1,context:a.context||this};var b=this;this.promise={then:function(a,c){return a&&b._register("resolve",a),c&&b._register("reject",c),b._oath.complete&&b._traverse(),this},onprogress:function(a){return b._register("progress",a),this},node:function(a){return this.then(function(b){a(null,b)},function(b){a(b)}),this}}}if(!a)var a={};var b=a.exports=c;return b.version="0.2.1",c.prototype.resolve=function(a){this._fulfill("resolve",a)},c.prototype.reject=function(a){this._fulfill("reject",a)},c.prototype.progress=function(a){var b=this._pending.progress;if(!b)return!1;for(var c=0;c<b.length;c++)b[c](a)},c.prototype._register=function(a,b){var c=this._oath.context,d=this._pending[a],e;if(b.length<2)e=function(a){return b.call(c,a)};else if(b.length==2)e=function(a,d){b.call(c,a,d)};else throw new Error("Oath: Invalid function registered - to many parameters.");d?d.push(e):this._pending[a]=[e]},c.prototype._fulfill=function(a,b){if(this._oath.complete)return!1;this._oath.complete={type:a,result:b},this._traverse()},c.prototype._traverse=function(){var a=this,b=this._oath.context,c=this._oath.complete.type;if(!this._pending[c])return!1;var d=function(){var b=a._pending[c].shift(),e=a._oath.complete.result;if(b.length<2){var f=b(e);f&&(a._oath.complete.result=f),a._pending[c].length&&d()}else{var g=function(b){b&&(a._oath.complete.result=b),a._pending[c].length&&d()};b(e,g)}};d()},b})
!function(a,b){typeof module!="undefined"?module.exports=b():typeof define=="function"&&typeof define.amd=="object"?define(b):this[a]=b()}("oath",function(){function c(a){a=a||{},this._pending={},this._oath={complete:!1,context:a.context||this};var b=this;this.promise={then:function(a,c,d){return a&&b._register("resolve",a),c&&b._register("reject",c),d&&b._register("progress",d),b._oath.complete&&b._traverse(),this},onprogress:function(a){return b._register("progress",a),this},node:function(a){return this.then(function(b){a(null,b)},function(b){a(b)}),this}}}if(!a)var a={};var b=a.exports=c;return b.version="0.2.2",c.prototype.resolve=function(a){this._fulfill("resolve",a)},c.prototype.reject=function(a){this._fulfill("reject",a)},c.prototype.progress=function(a){var b=this._pending.progress;if(!b)return!1;for(var c=0;c<b.length;c++)b[c](a)},c.prototype._register=function(a,b){var c=this._oath.context,d=this._pending[a],e;if(b.length<2)e=function(a){return b.call(c,a)};else if(b.length==2)e=function(a,d){b.call(c,a,d)};else throw new Error("Oath: Invalid function registered - to many parameters.");d?d.push(e):this._pending[a]=[e]},c.prototype._fulfill=function(a,b){if(this._oath.complete)return!1;this._oath.complete={type:a,result:b},this._traverse()},c.prototype._traverse=function(){var a=this,b=this._oath.context,c=this._oath.complete.type;if(!this._pending[c])return!1;var d=function(){var b=a._pending[c].shift(),e=a._oath.complete.result;if(b.length<2){var f=b(e);f&&(a._oath.complete.result=f),a._pending[c].length&&d()}else{var g=function(b){b&&(a._oath.complete.result=b),a._pending[c].length&&d()};b(e,g)}};d()},b})
0.2.2 / 2012-01-29
==================
* added progress as third argument for #then
0.2.1 / 2012-01-23

@@ -3,0 +8,0 @@ ==================

@@ -13,3 +13,3 @@ /*!

*/
exports.version = '0.2.1';
exports.version = '0.2.2';

@@ -64,5 +64,6 @@ /**

this.promise = {
then: function (success, failure) {
then: function (success, failure, progress) {
if (success) self._register('resolve', success);
if (failure) self._register('reject', failure);
if (progress) self._register('progress', progress);
if (self._oath.complete) self._traverse();

@@ -69,0 +70,0 @@ return this;

@@ -5,3 +5,3 @@ {

"description": "Tiny library for node and the browser that makes it easy to build and interact with promise/future based APIs.",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "http://alogicalparadox.com/oath",

@@ -8,0 +8,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc