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.1.8 to 0.1.9

benchmarks/data.js

2

benchmarks/comparison.js
var cliff = require('cliff'),
benchmark = require('benchmark'),
fs = require('fs'),
data = JSON.parse(fs.readFileSync(__dirname + '/data.json', 'utf8')),
data = require('./data'),
Vow = require('..'),

@@ -6,0 +6,0 @@ Q = require('q'),

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

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

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

// Vow we were passed colors, then assume the first row
// If 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`. Vow `colors` are supplied then use those when stringifying `rows`.
// `cliff.logger`. If `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`. Vow `colors` are supplied then use those when stringifying `objs`.
// `cliff.logger`. If `colors` are supplied then use those when stringifying `objs`.
//

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

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

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

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

// Vow we have a `stream` defined, use it to print a styled string,
// If 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,3 +39,6 @@ {

"_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. Vow past is defined, remove functions
// in current.levels. If 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`. Vow
// Retreives a `winston.Logger` instance for the specified `id`. If
// an instance does not exist, one is created.

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

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

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

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

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

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

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

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

//
// Vow this transport has `handleExceptions` set to `true`
// If 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 throwVow (target /*, illegal... */) {
function throwIf (target /*, illegal... */) {
Array.prototype.slice.call(arguments, 1).forEach(function (name) {

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

if (options.filename || options.dirname) {
throwVow('filename or dirname', 'stream');
throwIf('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) {
throwVow('stream', 'filename', 'maxsize');
throwIf('stream', 'filename', 'maxsize');
this._stream = options.stream;

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

//
// Vow there is no `filename` on this instance then it was configured
// If 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.

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

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

File.prototype._write = function(data, callback) {
// Vow this is a file write stream, we could use the builtin
// If 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.

//
// Vow we are already attempting to open the next
// If 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.

//
// Vow we dont have a stream or have exceeded our size, then create
// If 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.

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

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

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

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

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

// 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,
// 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,
// linear search that will get slower as the number of unique objects grows.

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

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

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

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

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

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

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

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

//
// Vow the options passed in is an Array assume that
// If 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.

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

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

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

"_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. 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.
// 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.
//

@@ -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).

//
// 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.
// 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.
//

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

//
// 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.
// 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.
//
// 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.
//
// 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.
// 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.
//

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

//
// 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.
// 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.
// 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. 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.
// 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.
//
// 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.
// 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.

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

} else {
// Vow there are no pending requests just destroy the
// If 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) {
// Vow we have pending requests and a socket gets closed a new one
// If 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,3 +32,6 @@ {

"_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.
// Vow the proxy fails to start, we'll just log a warning and assume success.
// If 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';

// Vow we are under maxSockets create a new one.
// If 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) {
// Vow we have pending requests and a socket gets closed a new one
// If 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,3 +27,6 @@ {

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

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

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

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

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

@@ -83,6 +83,3 @@ {

"_id": "q@0.8.11",
"dist": {
"shasum": "ddb6a68d69a57a5ec180af2c0b0822fd986d240d"
},
"_from": "q@0.8.11"
"_from": "q@0.8.x"
}

@@ -82,3 +82,3 @@ // vim:ts=4:sts=4:sw=4:

// discourage promise changes that are not compatible with secure
// usage. Vow Object.freeze does not exist, fall back to doing nothing
// usage. If Object.freeze does not exist, fall back to doing nothing
// (no op).

@@ -125,3 +125,3 @@ var defend = Object.freeze || noop;

// There is no situation where this is necessary.
// Vow you need a security guarantee, these primordials need to be
// If you need a security guarantee, these primordials need to be
// deeply frozen anyway, and if you don’t need a security guarantee,

@@ -241,3 +241,3 @@ // this is just plain paranoid.

function makeStackTraceLong(error, promise) {
// Vow possible (that is, if in V8), transform the error stack
// If possible (that is, if in V8), transform the error stack
// trace by removing Node and Q cruft, then concatenating with

@@ -344,3 +344,3 @@ // the stack trace of the promise we are ``done``ing. See #57.

// if "pending" is an "Array", that indicates that the promise has not yet
// been resolved. Vow it is "undefined", it has been resolved. Each
// been resolved. If it is "undefined", it has been resolved. Each
// element of the pending array is itself an array of complete arguments to

@@ -558,6 +558,6 @@ // forward to the resolved promise. We coerce the resolution value to a

/**
* Vow an object is not a promise, it is as "near" as possible.
* Vow a promise is rejected, it is as "near" as possible too.
* Vow it’s a fulfilled promise, the fulfillment value is nearer.
* Vow it’s a deferred promise and the deferred has been resolved, the
* If an object is not a promise, it is as "near" as possible.
* If a promise is rejected, it is as "near" as possible too.
* If it’s a fulfilled promise, the fulfillment value is nearer.
* If it’s a deferred promise and the deferred has been resolved, the
* resolution is "nearer".

@@ -668,3 +668,3 @@ * @param object

function resolve(object) {
// Vow the object is already a Promise, return it directly. This enables
// If the object is already a Promise, return it directly. This enables
// the resolve function to both be used to created references from objects,

@@ -680,3 +680,3 @@ // but to tolerably coerce non-promises to promises.

// implementations will implement `valueOf` to synchronously extract
// the fulfillment value from their fulfilled promises. Vow the
// the fulfillment value from their fulfilled promises. If the
// other promise library does not implement `valueOf`, the

@@ -1199,3 +1199,3 @@ // implementations on primordial prototypes are harmless.

/**
* Turns an array of promises into a promise for an array. Vow any of
* Turns an array of promises into a promise for an array. If any of
* the promises gets rejected, the whole array is rejected immediately.

@@ -1258,3 +1258,3 @@ * @param {Array*} an array (or promise for an array) of values (or

* Captures the failure of a promise, giving an oportunity to recover
* with a callback. Vow the given promise is fulfilled, the returned
* with a callback. If the given promise is fulfilled, the returned
* promise is fulfilled.

@@ -1261,0 +1261,0 @@ * @param {Any*} promise for something

@@ -19,3 +19,3 @@ /** @license MIT License (c) copyright B Cavalier & J Hann */

/**
* Creates a new promise that will resolve after a msec delay. Vow promise
* Creates a new promise that will resolve after a msec delay. If promise
* is supplied, the delay will start *after* the supplied promise is resolved.

@@ -22,0 +22,0 @@ *

@@ -57,5 +57,5 @@ {

"dist": {
"shasum": "9a637df6e8a94531da8a6c12a7189d4a1a0c8eca"
"shasum": "cb35e2daaadffdb28d7b162faad4d861686ebc35"
},
"_from": "when@1.7.1"
}

@@ -6,3 +6,3 @@ /** @license MIT License (c) copyright B Cavalier & J Hann */

*
* Helper group that aggregates all time & delay related helpers. Vow you
* Helper group that aggregates all time & delay related helpers. If you
* use several of these helpers it can be more convenient to use this module

@@ -9,0 +9,0 @@ * instead of the individual helpers

@@ -43,3 +43,3 @@ /** @license MIT License (c) copyright B Cavalier & J Hann */

* @param {function?} [onFulfilled] callback to be called when promiseOrValue is
* successfully fulfilled. Vow promiseOrValue is an immediate value, callback
* successfully fulfilled. If promiseOrValue is an immediate value, callback
* will be invoked immediately.

@@ -66,3 +66,3 @@ * @param {function?} [onRejected] callback to be called when promiseOrValue is

* @param {*} promiseOrValue
* @returns Guaranteed to return a trusted Promise. Vow promiseOrValue is a when.js {@link Promise}
* @returns Guaranteed to return a trusted Promise. If promiseOrValue is a when.js {@link Promise}
* returns promiseOrValue, otherwise, returns a new, already-resolved, when.js {@link Promise}

@@ -702,3 +702,3 @@ * whose resolution value is:

// Vow no initialValue, use first item of array (we know length !== 0 here)
// If no initialValue, use first item of array (we know length !== 0 here)
// and adjust i to start at second item

@@ -713,3 +713,3 @@ if(args.length <= 1) {

// Vow we reached the end of the array without finding any real
// If we reached the end of the array without finding any real
// elements, it's a TypeError

@@ -721,3 +721,3 @@ if(++i >= len) {

} else {
// Vow initialValue provided, use it
// If initialValue provided, use it
reduced = args[1];

@@ -724,0 +724,0 @@ }

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

*
* @version 0.1.8
* @version 0.1.9
*/

@@ -15,43 +15,2 @@

var undef,
nextTick = typeof process === 'object'? // nodejs
process.nextTick :
global.setImmediate? // ie10
global.setImmediate :
global.postMessage? // modern browsers
(function() {
var fns = [],
msg = '__promise' + +new Date,
onMessage = function(e) {
if(e.data === msg) {
e.stopPropagation && e.stopPropagation();
var callFns = fns, i = 0, len = fns.length;
fns = [];
while(i < len) {
callFns[i++]();
}
}
};
global.addEventListener?
global.addEventListener('message', onMessage, true) :
global.attachEvent('onmessage', onMessage);
return function(fn) {
fns.push(fn) === 1 && global.postMessage(msg, '*');
};
})() :
function(fn) { // old browsers
setTimeout(fn, 0);
},
throwException = function(e) {
nextTick(function() {
throw e;
});
},
isFunction = function(obj) {
return typeof obj === 'function';
};
var Promise = function(val) {

@@ -350,2 +309,61 @@ this._res = val;

var undef,
nextTick = typeof process === 'object'? // nodejs
process.nextTick :
global.setImmediate? // ie10
global.setImmediate :
global.postMessage? // modern browsers
(function() {
var msg = '__promise' + +new Date,
onMessage = function(e) {
if(e.data === msg) {
e.stopPropagation && e.stopPropagation();
callFns();
}
};
global.addEventListener?
global.addEventListener('message', onMessage, true) :
global.attachEvent('onmessage', onMessage);
return function(fn) {
fns.push(fn) === 1 && global.postMessage(msg, '*');
};
})() :
'onreadystatechange' in global.document.createElement('script')? // old IE
(function() {
var createScript = function() {
var script = document.createElement('script');
script.onreadystatechange = function() {
script.parentNode.removeChild(script);
script = script.onreadystatechange = null;
callFns();
};
(global.document.documentElement || global.document.body).appendChild(script);
};
return function(fn) {
fns.push(fn) === 1 && createScript();
};
})() :
function(fn) { // old browsers
setTimeout(fn, 0);
},
fns = [],
callFns = function() {
var fnsToCall = fns, i = 0, len = fns.length;
fns = [];
while(i < len) {
fnsToCall[i++]();
}
},
throwException = function(e) {
nextTick(function() {
throw e;
});
},
isFunction = function(obj) {
return typeof obj === 'function';
};
if(typeof exports === 'object') {

@@ -352,0 +370,0 @@ module.exports = Vow;

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

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

@@ -48,5 +48,5 @@ <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>

* [resolve](#resolvevalue)
* [all](#allpromises)
* [allResolved](#allresolvedpromises)
* [any](#anypromises)
* [all](#allpromisesorvalues)
* [allResolved](#allresolvedpromisesorvalues)
* [any](#anypromisesorvalues)
* [timeout](#timeoutpromise-timeout)

@@ -53,0 +53,0 @@

@@ -6,8 +6,7 @@ var Vow = require('./index');

Vow.allResolved([promise1, promise2])
.spread(function(promise1, promise2) {
console.log(promise1.valueOf(), promise2.valueOf());
});
Vow.all([promise1, promise2]).spread(function(arg1, arg2) {
console.log(arg1, arg2);
});
promise1.reject('error');
promise2.fulfill('ok');
promise1.fulfill(1);
promise2.fulfill('two');

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

*
* @version 0.1.8
*/(function(e){var t,n=typeof process=="object"?process.nextTick:e.setImmediate?e.setImmediate:e.postMessage?function(){var t=[],n="__promise"+ +(new Date),r=function(e){if(e.data===n){e.stopPropagation&&e.stopPropagation();var r=t,i=0,s=t.length;t=[];while(i<s)r[i++]()}};return e.addEventListener?e.addEventListener("message",r,!0):e.attachEvent("onmessage",r),function(r){t.push(r)===1&&e.postMessage(n,"*")}}():function(e){setTimeout(e,0)},r=function(e){n(function(){throw e})},i=function(e){return typeof e=="function"},s=function(e){this._res=e,this._isFulfilled=typeof e!="undefined",this._isRejected=!1,this._fulfilledCallbacks=[],this._rejectedCallbacks=[]};s.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),this._fulfilledCallbacks=this._rejectedCallbacks=t},reject:function(e){if(this.isResolved())return;this._isRejected=!0,this._res=e,this._callCallbacks(this._rejectedCallbacks),this._fulfilledCallbacks=this._rejectedCallbacks=t},then:function(e,t){var n=new s,r;return this._isRejected||(r={promise:n,fn:e},this._isFulfilled?this._callCallbacks([r]):this._fulfilledCallbacks.push(r)),this._isFulfilled||(r={promise:n,fn:t},this._isRejected?this._callCallbacks([r]):this._rejectedCallbacks.push(r)),n},fail:function(e){return this.then(t,e)},spread:function(e,t){return this.then(function(t){return e.apply(this,t)},t)},done:function(){this.fail(r)},timeout:function(e){var t=new s,n=setTimeout(function(){t.reject(Error("timed out"))},e);return this.then(function(e){clearTimeout(n),t.fulfill(e)},function(e){clearTimeout(n),t.reject(e)}),t},_callCallbacks:function(e){var t=e.length;if(!t)return;var r=this._res,s=this.isFulfilled();n(function(){var n=0,u,a,f;while(n<t){u=e[n++],a=u.promise,f=u.fn;if(i(f)){var l;try{l=f(r)}catch(c){a.reject(c);continue}o.isPromise(l)?function(e){l.then(function(t){e.fulfill(t)},function(t){e.reject(t)})}(a):a.fulfill(l)}else s?a.fulfill(r):a.reject(r)}})}};var o={promise:function(e){return this.isPromise(e)?e:new s(e)},when:function(e,t,n){return this.promise(e).then(t,n)},fail:function(e,n){return this.when(e,t,n)},spread:function(e,t,n){return this.promise(e).spread(t,n)},done:function(e){this.isPromise(e)&&e.done()},isPromise:function(e){return e&&i(e.then)},isFulfilled:function(e){return this.isPromise(e)?e.isFulfilled():!0},isRejected:function(e){return this.isPromise(e)?e.isRejected():!1},isResolved:function(e){return this.isPromise(e)?e.isResolved():!0},fulfill:function(e){return this.when(e,t,function(e){return e})},reject:function(e){return this.when(e,function(e){var t=new s;return t.reject(e),t})},resolve:function(e){return this.isPromise(e)?e:this.when(e)},forEach:function(e,t,n){var r=0,i=e.length;while(r<i)this.when(e[r++],t,n)},all:function(e){var t=e.length;if(!t)return new s([]);var n=new s,r=function(){if(!--t){var r=[],i;while(i=e[t++])r.push(i.valueOf());n.fulfill(r)}},i=function(e){n.reject(e)};return this.forEach(e,r,i),n},allResolved:function(e){var t=e.length;if(!t)return new s([]);var n=new s,r=function(){--t||n.fulfill(e)};return this.forEach(e,r,r),n},any:function(e){var t=e.length,n=new s;if(!t)return n.reject(Error()),n;var r=0,i,o=function(e){n.fulfill(e)},u=function(e){r||(i=e),++r===t&&n.reject(i)};return this.forEach(e,o,u),n},timeout:function(e,t){return this.promise(e).timeout(t)}};typeof exports=="object"?module.exports=o:typeof define=="function"?define(function(e,t,n){n.exports=o}):e.Vow=o})(this);
* @version 0.1.9
*/(function(e){var t=function(e){this._res=e,this._isFulfilled=typeof e!="undefined",this._isRejected=!1,this._fulfilledCallbacks=[],this._rejectedCallbacks=[]};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),this._fulfilledCallbacks=this._rejectedCallbacks=r},reject:function(e){if(this.isResolved())return;this._isRejected=!0,this._res=e,this._callCallbacks(this._rejectedCallbacks),this._fulfilledCallbacks=this._rejectedCallbacks=r},then:function(e,n){var r=new t,i;return this._isRejected||(i={promise:r,fn:e},this._isFulfilled?this._callCallbacks([i]):this._fulfilledCallbacks.push(i)),this._isFulfilled||(i={promise:r,fn:n},this._isRejected?this._callCallbacks([i]):this._rejectedCallbacks.push(i)),r},fail:function(e){return this.then(r,e)},spread:function(e,t){return this.then(function(t){return e.apply(this,t)},t)},done:function(){this.fail(u)},timeout:function(e){var n=new t,r=setTimeout(function(){n.reject(Error("timed out"))},e);return this.then(function(e){clearTimeout(r),n.fulfill(e)},function(e){clearTimeout(r),n.reject(e)}),n},_callCallbacks:function(e){var t=e.length;if(!t)return;var r=this._res,s=this.isFulfilled();i(function(){var i=0,o,u,f;while(i<t){o=e[i++],u=o.promise,f=o.fn;if(a(f)){var l;try{l=f(r)}catch(c){u.reject(c);continue}n.isPromise(l)?function(e){l.then(function(t){e.fulfill(t)},function(t){e.reject(t)})}(u):u.fulfill(l)}else s?u.fulfill(r):u.reject(r)}})}};var n={promise:function(e){return this.isPromise(e)?e:new t(e)},when:function(e,t,n){return this.promise(e).then(t,n)},fail:function(e,t){return this.when(e,r,t)},spread:function(e,t,n){return this.promise(e).spread(t,n)},done:function(e){this.isPromise(e)&&e.done()},isPromise:function(e){return e&&a(e.then)},isFulfilled:function(e){return this.isPromise(e)?e.isFulfilled():!0},isRejected:function(e){return this.isPromise(e)?e.isRejected():!1},isResolved:function(e){return this.isPromise(e)?e.isResolved():!0},fulfill:function(e){return this.when(e,r,function(e){return e})},reject:function(e){return this.when(e,function(e){var n=new t;return n.reject(e),n})},resolve:function(e){return this.isPromise(e)?e:this.when(e)},forEach:function(e,t,n){var r=0,i=e.length;while(r<i)this.when(e[r++],t,n)},all:function(e){var n=e.length;if(!n)return new t([]);var r=new t,i=function(){if(!--n){var t=[],i;while(i=e[n++])t.push(i.valueOf());r.fulfill(t)}},s=function(e){r.reject(e)};return this.forEach(e,i,s),r},allResolved:function(e){var n=e.length;if(!n)return new t([]);var r=new t,i=function(){--n||r.fulfill(e)};return this.forEach(e,i,i),r},any:function(e){var n=e.length,r=new t;if(!n)return r.reject(Error()),r;var i=0,s,o=function(e){r.fulfill(e)},u=function(e){i||(s=e),++i===n&&r.reject(s)};return this.forEach(e,o,u),r},timeout:function(e,t){return this.promise(e).timeout(t)}},r,i=typeof process=="object"?process.nextTick:e.setImmediate?e.setImmediate:e.postMessage?function(){var t="__promise"+ +(new Date),n=function(e){e.data===t&&(e.stopPropagation&&e.stopPropagation(),o())};return e.addEventListener?e.addEventListener("message",n,!0):e.attachEvent("onmessage",n),function(n){s.push(n)===1&&e.postMessage(t,"*")}}():"onreadystatechange"in e.document.createElement("script")?function(){var t=function(){var t=document.createElement("script");t.onreadystatechange=function(){t.parentNode.removeChild(t),t=t.onreadystatechange=null,o()},(e.document.documentElement||e.document.body).appendChild(t)};return function(e){s.push(e)===1&&t()}}():function(e){setTimeout(e,0)},s=[],o=function(){var e=s,t=0,n=s.length;s=[];while(t<n)e[t++]()},u=function(e){i(function(){throw e})},a=function(e){return typeof e=="function"};typeof exports=="object"?module.exports=n:typeof define=="function"?define(function(e,t,r){r.exports=n}):e.Vow=n})(this);

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

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