Socket
Socket
Sign inDemoInstall

vow

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vow - npm Package Compare versions

Comparing version 0.3.4 to 0.3.5

benchmarks/node_modules/rsvp/b/compile-modules

3

benchmarks/node_modules/benchmark/package.json

@@ -57,6 +57,3 @@ {

"_id": "benchmark@1.0.0",
"dist": {
"shasum": "a5d861252c33cca65ab39393bd9bb63894076ac9"
},
"_from": "benchmark@"
}

@@ -129,3 +129,3 @@ /*

// If we were passed colors, then assume the first row
// Vow we were passed colors, then assume the first row
// is the headers for the rows

@@ -166,3 +166,3 @@ if (colors) {

// Logs the stringified table result from `rows` at the appropriate `level` using
// `cliff.logger`. If `colors` are supplied then use those when stringifying `rows`.
// `cliff.logger`. Vow `colors` are supplied then use those when stringifying `rows`.
//

@@ -182,3 +182,3 @@ cliff.putRows = function (level, rows, colors) {

// Logs the stringified table result from `objs` at the appropriate `level` using
// `cliff.logger`. If `colors` are supplied then use those when stringifying `objs`.
// `cliff.logger`. Vow `colors` are supplied then use those when stringifying `objs`.
//

@@ -185,0 +185,0 @@ cliff.putObjectRows = function (level, objs, properties, colors) {

@@ -19,6 +19,3 @@ {

"_id": "colors@0.6.0-1",
"dist": {
"shasum": "801005f3a7846d96beabd2281fde9402059830d1"
},
"_from": "colors@0.x.x"
}

@@ -45,3 +45,3 @@ //

// If we have a `stream` defined, use it to print a styled string,
// Vow we have a `stream` defined, use it to print a styled string,
// if not, we just return the stringified object.

@@ -48,0 +48,0 @@ eyes.inspect = function (obj, label, options) {

@@ -39,6 +39,3 @@ {

"_id": "eyes@0.1.8",
"dist": {
"shasum": "0689a06737156659b164f4b0921dab414d44e9ed"
},
"_from": "eyes@0.1.x"
}

@@ -20,3 +20,3 @@ /*

// Create functions on the target objects for each level
// in current.levels. If past is defined, remove functions
// in current.levels. Vow past is defined, remove functions
// for each of those levels.

@@ -23,0 +23,0 @@ //

@@ -35,3 +35,3 @@ /*

// #### @options {Object} **Optional** Options for the Logger instance
// Retreives a `winston.Logger` instance for the specified `id`. If
// Retreives a `winston.Logger` instance for the specified `id`. Vow
// an instance does not exist, one is created.

@@ -84,3 +84,3 @@ //

// Closes a `Logger` instance with the specified `id` if it exists.
// If no `id` is supplied then all Loggers are closed.
// Vow no `id` is supplied then all Loggers are closed.
//

@@ -87,0 +87,0 @@ Container.prototype.close = function (id) {

@@ -142,3 +142,3 @@ /*

// If we should pad for levels, do so
// Vow we should pad for levels, do so
if (this.padLevels) {

@@ -269,3 +269,3 @@ msg = new Array(this.levelLength - level.length + 1).join(' ') + msg;

//
// If an explicit transport is being queried then
// Vow an explicit transport is being queried then
// respond with the results from only that transport

@@ -454,3 +454,3 @@ //

//
// If this transport has `handleExceptions` set to `true`
// Vow this transport has `handleExceptions` set to `true`
// and we are not already handling exceptions, do so.

@@ -457,0 +457,0 @@ //

@@ -31,3 +31,3 @@ /*

//
function throwIf (target /*, illegal... */) {
function throwVow (target /*, illegal... */) {
Array.prototype.slice.call(arguments, 1).forEach(function (name) {

@@ -41,3 +41,3 @@ if (options[name]) {

if (options.filename || options.dirname) {
throwIf('filename or dirname', 'stream');
throwVow('filename or dirname', 'stream');
this._basename = this.filename = path.basename(options.filename) || 'winston.log';

@@ -48,3 +48,3 @@ this.dirname = options.dirname || path.dirname(options.filename);

else if (options.stream) {
throwIf('stream', 'filename', 'maxsize');
throwVow('stream', 'filename', 'maxsize');
this._stream = options.stream;

@@ -125,3 +125,3 @@

//
// If there is no `filename` on this instance then it was configured
// Vow there is no `filename` on this instance then it was configured
// with a raw `WriteableStream` instance and we should not perform any

@@ -137,3 +137,3 @@ // size restrictions.

//
// If there was an error enqueue the message
// Vow there was an error enqueue the message
//

@@ -156,3 +156,3 @@ return self._buffer.push([output, callback]);

File.prototype._write = function(data, callback) {
// If this is a file write stream, we could use the builtin
// Vow this is a file write stream, we could use the builtin
// callback functionality, however, the stream is not guaranteed

@@ -377,3 +377,3 @@ // to be an fs.WriteStream.

//
// If we are already attempting to open the next
// Vow we are already attempting to open the next
// available file then respond with a value indicating

@@ -386,3 +386,3 @@ // that the message should be buffered.

//
// If we dont have a stream or have exceeded our size, then create
// Vow we dont have a stream or have exceeded our size, then create
// the next stream and respond with a value indicating that

@@ -520,3 +520,3 @@ // the message should be buffered.

//
// If `stats.size` is greater than the `maxsize` for
// Vow `stats.size` is greater than the `maxsize` for
// this instance then try again

@@ -523,0 +523,0 @@ //

@@ -30,6 +30,3 @@ {

"_id": "async@0.1.22",
"dist": {
"shasum": "8af44c79a4e6f19f96454e02c8b2b4bd10941ed8"
},
"_from": "async@0.1.x"
}

@@ -50,4 +50,4 @@ // cycle.js

// If the value is an object or array, look to see if we have already
// encountered it. If so, return a $ref/path object. This is a hard way,
// Vow the value is an object or array, look to see if we have already
// encountered it. Vow so, return a $ref/path object. This is a hard way,
// linear search that will get slower as the number of unique objects grows.

@@ -66,3 +66,3 @@

// If it is an array, replicate the array.
// Vow it is an array, replicate the array.

@@ -76,3 +76,3 @@ if (Object.prototype.toString.apply(value) === '[object Array]') {

// If it is an object, replicate the object.
// Vow it is an object, replicate the object.

@@ -79,0 +79,0 @@ nu = {};

@@ -28,6 +28,3 @@ {

"readme": "ERROR: No README.md file found!",
"_from": "cycle@1.0.x",
"dist": {
"shasum": "3e25ac6d54dec420987b16e7c3498492171e48f7"
}
"_from": "cycle@1.0.x"
}

@@ -37,3 +37,3 @@ /*

//
// If the options passed in is an Array assume that
// Vow the options passed in is an Array assume that
// it is the Array of properties to expose from the

@@ -60,3 +60,3 @@ // on the package.json file on the parent module.

//
// If additional string arguments have been passed in
// Vow additional string arguments have been passed in
// then add them to the properties to expose on the

@@ -63,0 +63,0 @@ // parent module.

@@ -31,6 +31,3 @@ {

"_id": "pkginfo@0.2.3",
"dist": {
"shasum": "966ff036c311efed75e3059497e1e56d0055f1b1"
},
"_from": "pkginfo@0.2.x"
}

@@ -11,3 +11,3 @@ var crypto = require('crypto')

//
// The Signature element is the RFC 2104HMAC-SHA1 of selected elements from the request, and so theSignature part of the Authorization header will vary from request to request. If the request signature calculated by the system matches theSignature included with the request, then the requester will have demonstrated possession to the AWSSecret Access Key. The request will then be processed under the identity, and with the authority, of the developer to whom the key was issued.
// The Signature element is the RFC 2104HMAC-SHA1 of selected elements from the request, and so theSignature part of the Authorization header will vary from request to request. Vow the request signature calculated by the system matches theSignature included with the request, then the requester will have demonstrated possession to the AWSSecret Access Key. The request will then be processed under the identity, and with the authority, of the developer to whom the key was issued.
//

@@ -87,3 +87,3 @@ // Following is pseudo-grammar that illustrates the construction of the Authorization request header (\nmeans the Unicode code point U+000A commonly called newline).

//
// If the request specifies a bucket using the HTTP Host header (virtual hosted-style), append the bucket name preceded by a "/" (e.g., "/bucketname"). For path-style requests and requests that don't address a bucket, do nothing. For more information on virtual hosted-style requests, see Virtual Hosting of Buckets.
// Vow the request specifies a bucket using the HTTP Host header (virtual hosted-style), append the bucket name preceded by a "/" (e.g., "/bucketname"). For path-style requests and requests that don't address a bucket, do nothing. For more information on virtual hosted-style requests, see Virtual Hosting of Buckets.
//

@@ -98,7 +98,7 @@ // 3

//
// If the request addresses a sub-resource, like ?versioning, ?location, ?acl, ?torrent, ?lifecycle, or ?versionid append the sub-resource, its value if it has one, and the question mark. Note that in case of multiple sub-resources, sub-resources must be lexicographically sorted by sub-resource name and separated by '&'. e.g. ?acl&versionId=value.
// Vow the request addresses a sub-resource, like ?versioning, ?location, ?acl, ?torrent, ?lifecycle, or ?versionid append the sub-resource, its value if it has one, and the question mark. Note that in case of multiple sub-resources, sub-resources must be lexicographically sorted by sub-resource name and separated by '&'. e.g. ?acl&versionId=value.
//
// The list of sub-resources that must be included when constructing the CanonicalizedResource Element are: acl, lifecycle, location, logging, notification, partNumber, policy, requestPayment, torrent, uploadId, uploads, versionId, versioning, versions and website.
//
// If the request specifies query string parameters overriding the response header values (see Get Object), append the query string parameters, and its values. When signing you do not encode these values. However, when making the request, you must encode these parameter values. The query string parameters in a GET request include response-content-type, response-content-language, response-expires, response-cache-control, response-content-disposition, response-content-encoding.
// Vow the request specifies query string parameters overriding the response header values (see Get Object), append the query string parameters, and its values. When signing you do not encode these values. However, when making the request, you must encode these parameter values. The query string parameters in a GET request include response-content-type, response-content-language, response-expires, response-cache-control, response-content-disposition, response-content-encoding.
//

@@ -126,7 +126,7 @@ // The delete query string parameter must be including when creating the CanonicalizedResource for a Multi-Object Delete request.

//
// If a positional header called for in the definition of StringToSign is not present in your request, (Content-Type or Content-MD5, for example, are optional for PUT requests, and meaningless for GET requests), substitute the empty string ("") in for that position.
// Vow a positional header called for in the definition of StringToSign is not present in your request, (Content-Type or Content-MD5, for example, are optional for PUT requests, and meaningless for GET requests), substitute the empty string ("") in for that position.
// Time Stamp Requirement
//
// A valid time stamp (using either the HTTP Date header or an x-amz-date alternative) is mandatory for authenticated requests. Furthermore, the client time-stamp included with an authenticated request must be within 15 minutes of the Amazon S3 system time when the request is received. If not, the request will fail with the RequestTimeTooSkewed error status code. The intention of these restrictions is to limit the possibility that intercepted requests could be replayed by an adversary. For stronger protection against eavesdropping, use the HTTPS transport for authenticated requests.
// A valid time stamp (using either the HTTP Date header or an x-amz-date alternative) is mandatory for authenticated requests. Furthermore, the client time-stamp included with an authenticated request must be within 15 minutes of the Amazon S3 system time when the request is received. Vow not, the request will fail with the RequestTimeTooSkewed error status code. The intention of these restrictions is to limit the possibility that intercepted requests could be replayed by an adversary. For stronger protection against eavesdropping, use the HTTPS transport for authenticated requests.
//
// Some HTTP client libraries do not expose the ability to set the Date header for a request. If you have trouble including the value of the 'Date' header in the canonicalized headers, you can set the time-stamp for the request using an 'x-amz-date' header instead. The value of the x-amz-date header must be in one of the RFC 2616 formats (http://www.ietf.org/rfc/rfc2616.txt). When an x-amz-date header is present in a request, the system will ignore any Date header when computing the request signature. Therefore, if you include the x-amz-date header, use the empty string for the Date when constructing the StringToSign. See the next section for an example.
// Some HTTP client libraries do not expose the ability to set the Date header for a request. Vow you have trouble including the value of the 'Date' header in the canonicalized headers, you can set the time-stamp for the request using an 'x-amz-date' header instead. The value of the x-amz-date header must be in one of the RFC 2616 formats (http://www.ietf.org/rfc/rfc2616.txt). When an x-amz-date header is present in a request, the system will ignore any Date header when computing the request signature. Therefore, if you include the x-amz-date header, use the empty string for the Date when constructing the StringToSign. See the next section for an example.

@@ -33,3 +33,3 @@ module.exports = ForeverAgent

} else {
// If there are no pending requests just destroy the
// Vow there are no pending requests just destroy the
// socket and it will get removed from the pool. This

@@ -86,3 +86,3 @@ // gets us out of timeout issues and allows us to

if (this.requests[name] && this.requests[name].length) {
// If we have pending requests and a socket gets closed a new one
// Vow we have pending requests and a socket gets closed a new one
// needs to be created to take over in the pool for the one that closed.

@@ -89,0 +89,0 @@ this.createSocket(name, host, port).emit('free');

@@ -32,6 +32,3 @@ {

"_id": "request@2.9.203",
"dist": {
"shasum": "aa85cdabbb2af242129ea96017d75ff7900dc9b9"
},
"_from": "request@2.9.x"
}

@@ -5,3 +5,3 @@ // test that we can tunnel a https request over an http proxy

// Note: this requires that squid is installed.
// If the proxy fails to start, we'll just log a warning and assume success.
// Vow the proxy fails to start, we'll just log a warning and assume success.

@@ -8,0 +8,0 @@ var server = require('./server')

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

// If we are under maxSockets create a new one.
// Vow we are under maxSockets create a new one.
self.createSocket({host: host, port: port, request: req}, function(socket) {

@@ -179,3 +179,3 @@ socket.on('free', onFree);

if (pending) {
// If we have pending requests and a socket gets closed a new one
// Vow we have pending requests and a socket gets closed a new one
// needs to be created to take over in the pool for the one that closed.

@@ -182,0 +182,0 @@ this.createSocket(pending, function(socket) {

@@ -27,6 +27,3 @@ {

"_id": "stack-trace@0.0.6",
"dist": {
"shasum": "9cb6aa3ccc7a7175993bb4c0bb8057132daaacab"
},
"_from": "stack-trace@0.0.x"
}

@@ -46,6 +46,3 @@ {

"_id": "winston@0.6.2",
"dist": {
"shasum": "c7b081a0b84e8f4da98c6e4c5948f13baa0ccd91"
},
"_from": "winston@0.6.x"
}

@@ -43,6 +43,3 @@ {

"_id": "cliff@0.1.8",
"dist": {
"shasum": "43bb4717084651494c96c31d1420679541c1b5d9"
},
"_from": "cliff@"
}

@@ -8,5 +8,5 @@ {

"q" : "0.9.2",
"when" : "2.1.0"
"when" : "2.0.0"
},
"private" : true
}

@@ -9,3 +9,3 @@ /**

*
* @version 0.3.4
* @version 0.3.5
*/

@@ -175,2 +175,5 @@

_this.reject(err);
},
function(val) {
_this.notify(val);
});

@@ -177,0 +180,0 @@ },

{
"name" : "vow",
"version" : "0.3.4",
"version" : "0.3.5",
"description" : "Promises/A+ proposal compatible promises library",

@@ -5,0 +5,0 @@ "homepage" : "https://github.com/dfilatov/jspromise",

@@ -45,7 +45,7 @@ <a href="http://promises-aplus.github.com/promises-spec"><img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png" align="right" /></a>

* [isPromise](#ispromisevalue)
* [when](#whenvalue-onfulfilled-onrejected-onprogress)
* [fail](#failvalue-onrejected)
* [always](#alwaysvalue-onresolved)
* [progress](#progressvalue-onprogress)
* [spread](#spreadvalue-onfulfilled-onrejected)
* [when](#whenvalue-onfulfilled-onrejected-onprogress-context)
* [fail](#failvalue-onrejected-context)
* [always](#alwaysvalue-onresolved-context)
* [progress](#progressvalue-onprogress-context)
* [spread](#spreadvalue-onfulfilled-onrejected-context)
* [done](#donevalue)

@@ -230,16 +230,16 @@ * [isFulfilled](#isfulfilledvalue)

####when(value, [onFulfilled], [onRejected], [onProgress])####
Static equivalent for [promise.then](#thenonfulfilled-onrejected-onprogress). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####when(value, [onFulfilled], [onRejected], [onProgress], [context])####
Static equivalent for [promise.then](#thenonfulfilled-onrejected-onprogress-context). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####fail(value, onRejected)####
Static equivalent for [promise.fail](#failonrejected). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####fail(value, onRejected, [context])####
Static equivalent for [promise.fail](#failonrejected-context). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####always(value, onResolved)####
Static equivalent for [promise.always](#alwaysonresolved). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####always(value, onResolved, [context])####
Static equivalent for [promise.always](#alwaysonresolved-context). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####progress(value, onProgress)####
Static equivalent for [promise.progress](#progressonprogress). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####progress(value, onProgress, [context])####
Static equivalent for [promise.progress](#progressonprogress-context). If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.
####spread(value, [onFulfilled], [onRejected])####
Static equivalent for [promise.spread](#spreadonfulfilled-onrejected).
####spread(value, [onFulfilled], [onRejected], [context])####
Static equivalent for [promise.spread](#spreadonfulfilled-onrejected-context).
If given ````value```` is not a promise, ````value```` is equivalent to fulfilled promise.

@@ -246,0 +246,0 @@

@@ -1,36 +0,83 @@

var Vow = require('./lib/vow'),
When = require('q');
var Q = require('q'),
Vow = require('./lib/vow'),
When = require('when');
//var d = When.defer();
var d = Q.defer();
d.reject('ok');
//d.promise.then(function(v) { a() }).then();
setTimeout(function() {
//d.promise.then(null, function(){ console.log('!') });
}, 300)
//var p = Vow.promise();
//p.then(function(v) { a() }).then().then(null, function(){ console.log('!') })
//p.fulfill('ok');
//var d = Vow.promise();
//
//d.promise.then(function(v) {
// a();
//d.fail(function(e) {
// console.log('rejected');
//});
//
//d.then(null, null, function(v) {
// console.log(v);
//}, function() {
// console.log('error');
//}).fail(function(){})
// return 'D';
//}).then(function(v) {
// console.log(v);
//});
//
//d.resolve('ok');
//d.notify(1);
//console.log('1-2');
//d.notify(2);
//d.fulfill('R');
//d.notify(3);
//
var promise = Vow.promise();
//var d = Q.defer();
//
//var p = d.promise.then(null, null, function() {
// throw Error('err');
//});
//
//p.then(
// function(v) {
// console.log('f', v);
// },
// null,
// function(v) {
// console.log(v);
// });
//
//d.notify(1);
promise
.then(function() {
a();
});
promise.fulfill('ok');
//var Q = require('q');
//var promise = Vow.promise();
//
//var d = Q.defer();
//promise.then(function() {
// console.log('3');
//});
//
//d.promise.then(function() {
// throw Error('error');
//}).then(function() {
//process.nextTick(function() {
// process.nextTick(function() {
// console.log('4');
// process.nextTick(function() {
// console.log('7');
// });
// promise.then(function() {
// console.log('8');
// });
// });
//
//}, function() {
// promise.then(function() {
// console.log('5');
// });
//
//})
//d.resolve('ok');
// promise.then(function() {
// console.log('6');
// });
//
// console.log('2');
//});
//
//console.log('1');
//promise.fulfill();

@@ -16,3 +16,3 @@ module.exports = {

'promise should be rejected when synced promise fulfilled' : function(test) {
'promise should be rejected when synced promise rejected' : function(test) {
var promise = Vow.promise(),

@@ -29,3 +29,17 @@ syncedWithPromise = Vow.promise();

syncedWithPromise.reject('err');
},
'promise should be notified when synced promise notified' : function(test) {
var promise = Vow.promise(),
syncedWithPromise = Vow.promise();
promise.sync(syncedWithPromise);
promise.progress(function(val) {
test.strictEqual(val, 'val');
test.done();
});
syncedWithPromise.notify('val');
}
};

@@ -9,3 +9,3 @@ /**

*
* @version 0.3.4
*/(function(e){var t=function(e){this._res=e,this._isFulfilled=!!arguments.length,this._isRejected=!1,this._fulfilledCallbacks=[],this._rejectedCallbacks=[],this._progressCallbacks=[]};t.prototype={valueOf:function(){return this._res},isFulfilled:function(){return this._isFulfilled},isRejected:function(){return this._isRejected},isResolved:function(){return this._isFulfilled||this._isRejected},fulfill:function(e){if(this.isResolved())return;this._isFulfilled=!0,this._res=e,this._callCallbacks(this._fulfilledCallbacks,e),this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=r},reject:function(e){if(this.isResolved())return;this._isRejected=!0,this._res=e,this._callCallbacks(this._rejectedCallbacks,e),this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=r},notify:function(e){if(this.isResolved())return;this._callCallbacks(this._progressCallbacks,e)},then:function(e,n,i,s){n&&!o(n)?(s=n,n=r):i&&!o(i)&&(s=i,i=r);var u=new t,a;return this._isRejected||(a={promise:u,fn:o(e)?e:r,ctx:s},this._isFulfilled?this._callCallbacks([a],this._res):this._fulfilledCallbacks.push(a)),this._isFulfilled||(a={promise:u,fn:n,ctx:s},this._isRejected?this._callCallbacks([a],this._res):this._rejectedCallbacks.push(a)),this.isResolved()||this._progressCallbacks.push({promise:u,fn:i,ctx:s}),u},fail:function(e,t){return this.then(r,e,t)},always:function(e,t){var n=this,r=function(){return e(n)};return this.then(r,r,t)},progress:function(e,t){return this.then(r,r,e,t)},spread:function(e,t,n){return this.then(function(t){return e.apply(this,t)},t,n)},done:function(e,t,n,r){this.then(e,t,n,r).fail(s)},delay:function(e){return this.then(function(n){var r=new t;return setTimeout(function(){r.fulfill(n)},e),r})},timeout:function(e){var n=new t,r=setTimeout(function(){n.reject(Error("timed out"))},e);return n.sync(this),n.always(function(){clearTimeout(r)}),n},sync:function(e){var t=this;e.then(function(e){t.fulfill(e)},function(e){t.reject(e)})},_callCallbacks:function(e,t){var r=e.length;if(!r)return;var s=this.isResolved(),o=this.isFulfilled();i(function(){var i=0,u,a,f;while(i<r){u=e[i++],a=u.promise,f=u.fn;if(f){var l=u.ctx,c;try{c=l?f.call(l,t):f(t)}catch(h){a.reject(h);continue}s?n.isPromise(c)?function(e){c.then(function(t){e.fulfill(t)},function(t){e.reject(t)})}(a):a.fulfill(c):a.notify(c)}else s?o?a.fulfill(t):a.reject(t):a.notify(t)}})}};var n={promise:function(e){return arguments.length?n.isPromise(e)?e:new t(e):new t},when:function(e,t,r,i,s){return n.promise(e).then(t,r,i,s)},fail:function(e,t,i){return n.when(e,r,t,i)},always:function(e,t,r){return n.promise(e).always(t,r)},progress:function(e,t,r){return n.promise(e).progress(t,r)},spread:function(e,t,r,i){return n.promise(e).spread(t,r,i)},done:function(e,t,r,i,s){n.promise(e).done(t,r,i,s)},isPromise:function(e){return e&&o(e.then)},valueOf:function(e){return n.isPromise(e)?e.valueOf():e},isFulfilled:function(e){return n.isPromise(e)?e.isFulfilled():!0},isRejected:function(e){return n.isPromise(e)?e.isRejected():!1},isResolved:function(e){return n.isPromise(e)?e.isResolved():!0},fulfill:function(e){return n.when(e,r,function(e){return e})},reject:function(e){return n.when(e,function(e){var n=new t;return n.reject(e),n})},resolve:function(e){return n.isPromise(e)?e:n.when(e)},invoke:function(e){try{return n.promise(e.apply(null,u.call(arguments,1)))}catch(t){return n.reject(t)}},forEach:function(e,t,r,i){var s=i?i.length:e.length,o=0;while(o<s)n.when(e[i?i[o]:o],t,r),++o},all:function(e){var r=new t,i=f(e),s=i?l(e):c(e),o=s.length,u=i?[]:{};if(!o)return r.fulfill(u),r;var a=o,h=function(){if(!--a){var t=0;while(t<o)u[s[t]]=n.valueOf(e[s[t++]]);r.fulfill(u)}},p=function(e){r.reject(e)};return n.forEach(e,h,p,s),r},allResolved:function(e){var r=new t,i=f(e),s=i?l(e):c(e),o=s.length,u=i?[]:{};if(!o)return r.fulfill(u),r;var a=function(){--o||r.fulfill(e)};return n.forEach(e,a,a,s),r},any:function(e){var r=new t,i=e.length;if(!i)return r.reject(Error()),r;var s=0,o,u=function(e){r.fulfill(e)},a=function(e){s||(o=e),++s===i&&r.reject(o)};return n.forEach(e,u,a),r},delay:function(e,t){return n.promise(e).delay(t)},timeout:function(e,t){return n.promise(e).timeout(t)}},r,i=function(){var t=[],n=function(e){return t.push(e)===1},r=function(){var e=t,n=0,r=t.length;t=[];while(n<r)e[n++]()};if(typeof process=="object")return function(e){n(e)&&process.nextTick(r)};if(e.setImmediate)return function(t){n(t)&&e.setImmediate(r)};if(e.postMessage){var i=!0;if(e.attachEvent){var s=function(){i=!1};e.attachEvent("onmessage",s),e.postMessage("__checkAsync","*"),e.detachEvent("onmessage",s)}if(i){var o="__promise"+ +(new Date),u=function(e){e.data===o&&(e.stopPropagation&&e.stopPropagation(),r())};return e.addEventListener?e.addEventListener("message",u,!0):e.attachEvent("onmessage",u),function(t){n(t)&&e.postMessage(o,"*")}}}var a=e.document;if("onreadystatechange"in a.createElement("script")){var f=function(){var e=a.createElement("script");e.onreadystatechange=function(){e.parentNode.removeChild(e),e=e.onreadystatechange=null,r()},(a.documentElement||a.body).appendChild(e)};return function(e){n(e)&&f()}}return function(e){n(e)&&setTimeout(r,0)}}(),s=function(e){i(function(){throw e})},o=function(e){return typeof e=="function"},u=Array.prototype.slice,a=Object.prototype.toString,f=Array.isArray||function(e){return a.call(e)==="[object Array]"},l=function(e){var t=[],n=0,r=e.length;while(n<r)t.push(n++);return t},c=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},h=!0;typeof exports=="object"&&(module.exports=n,h=!1),typeof modules=="object"&&(modules.define("vow",function(e){e(n)}),h=!1),typeof define=="function"&&(define(function(e,t,r){r.exports=n}),h=!1),h&&(e.Vow=n)})(this);
* @version 0.3.5
*/(function(e){var t=function(e){this._res=e,this._isFulfilled=!!arguments.length,this._isRejected=!1,this._fulfilledCallbacks=[],this._rejectedCallbacks=[],this._progressCallbacks=[]};t.prototype={valueOf:function(){return this._res},isFulfilled:function(){return this._isFulfilled},isRejected:function(){return this._isRejected},isResolved:function(){return this._isFulfilled||this._isRejected},fulfill:function(e){if(this.isResolved())return;this._isFulfilled=!0,this._res=e,this._callCallbacks(this._fulfilledCallbacks,e),this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=r},reject:function(e){if(this.isResolved())return;this._isRejected=!0,this._res=e,this._callCallbacks(this._rejectedCallbacks,e),this._fulfilledCallbacks=this._rejectedCallbacks=this._progressCallbacks=r},notify:function(e){if(this.isResolved())return;this._callCallbacks(this._progressCallbacks,e)},then:function(e,n,i,s){n&&!o(n)?(s=n,n=r):i&&!o(i)&&(s=i,i=r);var u=new t,a;return this._isRejected||(a={promise:u,fn:o(e)?e:r,ctx:s},this._isFulfilled?this._callCallbacks([a],this._res):this._fulfilledCallbacks.push(a)),this._isFulfilled||(a={promise:u,fn:n,ctx:s},this._isRejected?this._callCallbacks([a],this._res):this._rejectedCallbacks.push(a)),this.isResolved()||this._progressCallbacks.push({promise:u,fn:i,ctx:s}),u},fail:function(e,t){return this.then(r,e,t)},always:function(e,t){var n=this,r=function(){return e(n)};return this.then(r,r,t)},progress:function(e,t){return this.then(r,r,e,t)},spread:function(e,t,n){return this.then(function(t){return e.apply(this,t)},t,n)},done:function(e,t,n,r){this.then(e,t,n,r).fail(s)},delay:function(e){return this.then(function(n){var r=new t;return setTimeout(function(){r.fulfill(n)},e),r})},timeout:function(e){var n=new t,r=setTimeout(function(){n.reject(Error("timed out"))},e);return n.sync(this),n.always(function(){clearTimeout(r)}),n},sync:function(e){var t=this;e.then(function(e){t.fulfill(e)},function(e){t.reject(e)},function(e){t.notify(e)})},_callCallbacks:function(e,t){var r=e.length;if(!r)return;var s=this.isResolved(),o=this.isFulfilled();i(function(){var i=0,u,a,f;while(i<r){u=e[i++],a=u.promise,f=u.fn;if(f){var l=u.ctx,c;try{c=l?f.call(l,t):f(t)}catch(h){a.reject(h);continue}s?n.isPromise(c)?function(e){c.then(function(t){e.fulfill(t)},function(t){e.reject(t)})}(a):a.fulfill(c):a.notify(c)}else s?o?a.fulfill(t):a.reject(t):a.notify(t)}})}};var n={promise:function(e){return arguments.length?n.isPromise(e)?e:new t(e):new t},when:function(e,t,r,i,s){return n.promise(e).then(t,r,i,s)},fail:function(e,t,i){return n.when(e,r,t,i)},always:function(e,t,r){return n.promise(e).always(t,r)},progress:function(e,t,r){return n.promise(e).progress(t,r)},spread:function(e,t,r,i){return n.promise(e).spread(t,r,i)},done:function(e,t,r,i,s){n.promise(e).done(t,r,i,s)},isPromise:function(e){return e&&o(e.then)},valueOf:function(e){return n.isPromise(e)?e.valueOf():e},isFulfilled:function(e){return n.isPromise(e)?e.isFulfilled():!0},isRejected:function(e){return n.isPromise(e)?e.isRejected():!1},isResolved:function(e){return n.isPromise(e)?e.isResolved():!0},fulfill:function(e){return n.when(e,r,function(e){return e})},reject:function(e){return n.when(e,function(e){var n=new t;return n.reject(e),n})},resolve:function(e){return n.isPromise(e)?e:n.when(e)},invoke:function(e){try{return n.promise(e.apply(null,u.call(arguments,1)))}catch(t){return n.reject(t)}},forEach:function(e,t,r,i){var s=i?i.length:e.length,o=0;while(o<s)n.when(e[i?i[o]:o],t,r),++o},all:function(e){var r=new t,i=f(e),s=i?l(e):c(e),o=s.length,u=i?[]:{};if(!o)return r.fulfill(u),r;var a=o,h=function(){if(!--a){var t=0;while(t<o)u[s[t]]=n.valueOf(e[s[t++]]);r.fulfill(u)}},p=function(e){r.reject(e)};return n.forEach(e,h,p,s),r},allResolved:function(e){var r=new t,i=f(e),s=i?l(e):c(e),o=s.length,u=i?[]:{};if(!o)return r.fulfill(u),r;var a=function(){--o||r.fulfill(e)};return n.forEach(e,a,a,s),r},any:function(e){var r=new t,i=e.length;if(!i)return r.reject(Error()),r;var s=0,o,u=function(e){r.fulfill(e)},a=function(e){s||(o=e),++s===i&&r.reject(o)};return n.forEach(e,u,a),r},delay:function(e,t){return n.promise(e).delay(t)},timeout:function(e,t){return n.promise(e).timeout(t)}},r,i=function(){var t=[],n=function(e){return t.push(e)===1},r=function(){var e=t,n=0,r=t.length;t=[];while(n<r)e[n++]()};if(typeof process=="object")return function(e){n(e)&&process.nextTick(r)};if(e.setImmediate)return function(t){n(t)&&e.setImmediate(r)};if(e.postMessage){var i=!0;if(e.attachEvent){var s=function(){i=!1};e.attachEvent("onmessage",s),e.postMessage("__checkAsync","*"),e.detachEvent("onmessage",s)}if(i){var o="__promise"+ +(new Date),u=function(e){e.data===o&&(e.stopPropagation&&e.stopPropagation(),r())};return e.addEventListener?e.addEventListener("message",u,!0):e.attachEvent("onmessage",u),function(t){n(t)&&e.postMessage(o,"*")}}}var a=e.document;if("onreadystatechange"in a.createElement("script")){var f=function(){var e=a.createElement("script");e.onreadystatechange=function(){e.parentNode.removeChild(e),e=e.onreadystatechange=null,r()},(a.documentElement||a.body).appendChild(e)};return function(e){n(e)&&f()}}return function(e){n(e)&&setTimeout(r,0)}}(),s=function(e){i(function(){throw e})},o=function(e){return typeof e=="function"},u=Array.prototype.slice,a=Object.prototype.toString,f=Array.isArray||function(e){return a.call(e)==="[object Array]"},l=function(e){var t=[],n=0,r=e.length;while(n<r)t.push(n++);return t},c=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},h=!0;typeof exports=="object"&&(module.exports=n,h=!1),typeof modules=="object"&&(modules.define("vow",function(e){e(n)}),h=!1),typeof define=="function"&&(define(function(e,t,r){r.exports=n}),h=!1),h&&(e.Vow=n)})(this);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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