Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

q

Package Overview
Dependencies
Maintainers
1
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

q - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

5

CHANGES.md
<!-- vim:ts=4:sts=4:sw=4:et:tw=60 -->
## 0.8.1
- Fixed opera bug. #35 @cadorn
- Fixed ``Q.all([])`` #32 @domenicdenicola
## 0.8.0

@@ -4,0 +9,0 @@

4

package.json
{
"name": "q",
"version": "0.8.0",
"version": "0.8.1",
"description": "A library for promises (CommonJS/Promises/A,B,D)",

@@ -13,3 +13,3 @@ "homepage": "http://github.com/kriskowal/q/",

"mail": "kris@cixar.com",
"web": "http://github.com/kriskowal/q/issues"
"url": "http://github.com/kriskowal/q/issues"
},

@@ -16,0 +16,0 @@ "licenses": [

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

tail = tail.next = {task: task};
channel.port2.postMessage();
channel.port2.postMessage(0);
};

@@ -733,3 +733,3 @@ } else {

if (countDown === 0)
return ref(values);
return ref(promises);
var deferred = defer();

@@ -736,0 +736,0 @@ reduce.call(promises, function (undefined, promise, index) {

@@ -1,11 +0,12 @@

(function(k,c){typeof define==="function"?define(function(c,e,q){k(c,e,q)}):typeof exports==="object"?k(require,exports,module):Q=k(c,{},{})})(function(k,c,G,e){function q(a){return a}function n(){var a=[],b,d=r(f.prototype);d.promiseSend=function(){var d=j.call(arguments);a?a.push(d):l(function(){b.promiseSend.apply(b,d)})};d.valueOf=function(){return a?d:b.valueOf()};var c=function(d){if(a)return b=h(d),t.call(a,function(a,d){l(function(){b.promiseSend.apply(b,d)})},e),a=e,b};return{promise:u(d),
resolve:c,reject:function(a){return c(i(a))}}}function f(a,b,d){b===e&&(b=function(a){return i("Promise does not support operation: "+a)});var c=r(f.prototype);c.promiseSend=function(d,c){var x=j.call(arguments,2),e;try{e=a[d]?a[d].apply(a,x):b.apply(a,[d].concat(x))}catch(f){e=i(f)}return(c||q)(e)};if(d)c.valueOf=d;return u(c)}function s(a){return a&&typeof a.promiseSend==="function"}function y(a){a=o(a);return a===e||a===z?!1:!!a.promiseRejected}function i(a){return f({when:function(b){return b?
b(a):i(a)}},function(){return i(a)},function(){var b=r(i.prototype);b.promiseRejected=!0;b.reason=a;return b})}function h(a){return s(a)?a:a&&typeof a.then==="function"?f({},function(b){return b!=="when"?g(a,function(a){return h(a).promiseSend.apply(e,arguments)}):(b=n(),a.then(b.resolve,b.reject),b.promise)}):f({when:function(){return a},get:function(b){return a[b]},put:function(b,d){return a[b]=d},del:function(b){return delete a[b]},post:function(b,d){return a[b].apply(a,d)},apply:function(b,d){return a.apply(b,
d)},viewInfo:function(){for(var b=a,d={};b;)Object.getOwnPropertyNames(b).forEach(function(a){d[a]||(d[a]=typeof b[a])}),b=Object.getPrototypeOf(b);return{type:typeof a,properties:d}},keys:function(){return H(a)}},e,function(){return a})}function A(a,b){a=h(a);return b?f({viewInfo:function(){return b}},function(b){var c=j.call(arguments);return p.apply(e,[a].concat(c))},function(){return o(a)}):p(a,"viewInfo")}function g(a,b,d){function c(a){try{return b?b(a):a}catch(d){return i(d)}}function e(a){try{return d?
d(a):i(a)}catch(b){return i(b)}}var f=n(),g=!1;l(function(){h(a).promiseSend("when",function(a){g||(g=!0,f.resolve(h(a).promiseSend("when",c,e)))},function(a){g||(g=!0,f.resolve(e(a)))})});return f.promise}function m(a){return function(b){var d=j.call(arguments,1);return p.apply(e,[b,a].concat(d))}}function p(a,b){var d=n(),c=j.call(arguments,2),a=h(a);l(function(){a.promiseSend.apply(a,[b,d.resolve].concat(c))});return d.promise}function v(a){return g(a,function(a){var d=a.length,c=[];if(d===0)return h(c);
var f=n();t.call(a,function(a,b,e){g(b,function(a){c[e]=a;--d===0&&f.resolve(c)},f.reject)},e);return f.promise})}var l;try{l=k("event-queue").enqueue}catch(I){if(typeof MessageChannel!=="undefined"){var B=new MessageChannel,w={},C=w;B.port1.onmessage=function(){var a=w.next,b=a.task;w=a;b()};l=function(a){C=C.next={task:a};B.port2.postMessage()}}else l=function(a){setTimeout(a,0)}}var k=function(a,b,d){a[b]||(a[b]=d);return a[b]},u=k(Object,"freeze",q),r=k(Object,"create",function(a){var b=function(){};
b.prototype=a;return new b}),H=k(Object,"keys",function(a){var b=[],d;for(d in a)b.push(d);return b}),t=Array.prototype.reduce||function(a,b){var d=0,c=this.length;if(arguments.length==1){do{if(d in this){b=this[d++];break}if(++d>=c)throw new TypeError;}while(1)}for(;d<c;d++)d in this&&(b=a(b,this[d],d));return b},j=Array.prototype.slice,z=null,o=function(a){return a===e||a===z?a:a.valueOf()};c.enqueue=c.nextTick=l;c.defer=n;c.makePromise=f;f.prototype.then=function(a,b){return g(this,a,b)};t.call("when,send,get,put,del,post,invoke,keys,apply,call,all,wait,join,fail,fin,spy,view,viewInfo,end".split(","),
function(a,b){f.prototype[b]=function(){return c[b].apply(c,[this].concat(j.call(arguments)))}},e);f.prototype.toSource=function(){return this.toString()};f.prototype.toString=function(){return"[object Promise]"};u(f.prototype);c.isPromise=s;c.isResolved=function(a){return!s(o(a))};c.isFulfilled=function(a){return!s(o(a))&&!y(a)};c.isRejected=y;c.reject=i;i.prototype=r(f.prototype,{constructor:{value:i}});c.ref=h;c.master=c.def=function(a){return f({isDef:function(){}},function(b){var d=j.call(arguments);
return p.apply(e,[a].concat(d))},function(){return o(a)})};c.viewInfo=A;c.view=function(a){return A(a).when(function(b){var d;d=b.type==="function"?function(){return D(a,e,arguments)}:{};var c=b.properties||{};Object.keys(c).forEach(function(b){c[b]==="function"&&(d[b]=function(){return E(a,b,arguments)})});return h(d)})};c.when=g;c.async=function(a){return function(){var b=function(a,b){var f;try{f=d[a](b)}catch(h){return Object.prototype.toString.call(h)==="[object StopIteration]"?h.value:i(h)}return g(f,
c,e)},d=a.apply(this,arguments),c=b.bind(b,"send"),e=b.bind(b,"throw");return c()}};c.Method=m;c.send=p;c.get=m("get");c.put=m("put");c.del=m("del");var E=c.post=m("post");c.invoke=function(a,b){var d=j.call(arguments,2);return E(a,b,d)};var D=c.apply=m("apply");c.call=function(a,b){var d=j.call(arguments,2);return D(a,b,d)};c.keys=m("keys");c.all=v;c.wait=function(a){return v(arguments).get(0)};c.join=function(){var a=j.call(arguments),b=a.pop();return v(a).then(function(a){return b.apply(e,a)})};
c.fail=function(a,b){return g(a,e,b)};c.spy=c.fin=function(a,b){return g(a,function(a){return g(b(),function(){return a})},function(a){return g(b(),function(){return i(a)})})};c.end=function(a){g(a,e,function(a){l(function(){throw a;})})};for(var F in c)h[F]=c[F];return G.exports=h});
(function(n){"function"===typeof define?define(n):"object"===typeof exports?n(require,exports):n(void 0,Q={})})(function(n,d){function y(a){return a}function h(){var a=[],b,c=o(h.prototype),f=o(e.prototype);f.promiseSend=function(){var c=i.call(arguments);a?a.push(c):k(function(){b.promiseSend.apply(b,c)})};f.valueOf=function(){return a?f:b.valueOf()};var d=function(c){if(a)return b=l(c),s.call(a,function(a,c){k(function(){b.promiseSend.apply(b,c)})},void 0),a=void 0,b};c.promise=u(f);c.resolve=d;
c.reject=function(a){return d(j(a))};return c}function e(a,b,c){void 0===b&&(b=function(a){return j("Promise does not support operation: "+a)});var f=o(e.prototype);f.promiseSend=function(c,f){var d=i.call(arguments,2),t;try{t=a[c]?a[c].apply(a,d):b.apply(a,[c].concat(d))}catch(e){t=j(e)}return(f||y)(t)};if(c)f.valueOf=c;return u(f)}function r(a){return a&&"function"===typeof a.promiseSend}function z(a){a=p(a);return void 0===a||null===a?!1:!!a.promiseRejected}function j(a){return e({when:function(b){return b?
b(a):j(a)}},function(){return j(a)},function(){var b=o(j.prototype);b.promiseRejected=!0;b.reason=a;return b})}function l(a){if(r(a))return a;if(a&&"function"===typeof a.then){var b=h();a.then(b.resolve,b.reject);return b.promise}return e({when:function(){return a},get:function(b){return a[b]},put:function(b,f){return a[b]=f},del:function(b){return delete a[b]},post:function(b,f){return a[b].apply(a,f)},apply:function(b,f){return a.apply(b,f)},viewInfo:function(){for(var b=a,f={};b;)Object.getOwnPropertyNames(b).forEach(function(a){f[a]||
(f[a]=typeof b[a])}),b=Object.getPrototypeOf(b);return{type:typeof a,properties:f}},keys:function(){return F(a)}},void 0,function(){return a})}function A(a,b){a=l(a);return b?e({viewInfo:function(){return b}},function(b){var f=i.call(arguments);return q.apply(void 0,[a].concat(f))},function(){return p(a)}):q(a,"viewInfo")}function g(a,b,c){function f(a){try{return b?b(a):a}catch(c){return j(c)}}function d(a){try{return c?c(a):j(a)}catch(b){return j(b)}}var e=h(),g=!1;k(function(){l(a).promiseSend("when",
function(a){g||(g=!0,e.resolve(l(a).promiseSend("when",f,d)))},function(a){g||(g=!0,e.resolve(d(a)))})});return e.promise}function m(a){return function(b){var c=i.call(arguments,1);return q.apply(void 0,[b,a].concat(c))}}function q(a,b){var c=h(),d=i.call(arguments,2),a=l(a);k(function(){a.promiseSend.apply(a,[b,c.resolve].concat(d))});return c.promise}function B(a){if(1<arguments.length)var b=Array.prototype.slice.call(arguments,1),a=a.bind.apply(a,b);return function(){var b=h(),d=i.call(arguments);
d.push(b.node());v(a,this,d).fail(b.reject);return b.promise}}var k;try{k=n("event-queue").enqueue}catch(G){if("undefined"!==typeof MessageChannel){var C=new MessageChannel,w={},D=w;C.port1.onmessage=function(){var a=w.next,b=a.task;w=a;b()};k=function(a){D=D.next={task:a};C.port2.postMessage(0)}}else k=function(a){setTimeout(a,0)}}var x=function(a,b,c){a[b]||(a[b]=c);return a[b]},u=x(Object,"freeze",y),o=x(Object,"create",function(a){var b=function(){};b.prototype=a;return new b}),F=x(Object,"keys",
function(a){var b=[],c;for(c in a)b.push(c);return b}),s=Array.prototype.reduce||function(a,b){var c=0,d=this.length;if(1==arguments.length){do{if(c in this){b=this[c++];break}if(++c>=d)throw new TypeError;}while(1)}for(;c<d;c++)c in this&&(b=a(b,this[c],c));return b},i=Array.prototype.slice,p=function(a){return void 0===a||null===a?a:a.valueOf()};d.nextTick=k;d.defer=h;h.prototype.node=function(){var a=this;return function(b,c){b?a.reject(b):2<arguments.length?a.resolve(Array.prototype.slice.call(arguments,
1)):a.resolve(c)}};d.makePromise=e;e.prototype.then=function(a,b){return g(this,a,b)};s.call("when,spread,send,get,put,del,post,invoke,keys,apply,call,all,wait,join,fail,fin,view,viewInfo,timeout,delay,end".split(","),function(a,b){e.prototype[b]=function(){return d[b].apply(d,[this].concat(i.call(arguments)))}},void 0);e.prototype.toSource=function(){return this.toString()};e.prototype.toString=function(){return"[object Promise]"};u(e.prototype);d.isPromise=r;d.isResolved=function(a){return!r(p(a))};
d.isFulfilled=function(a){return!r(p(a))&&!z(a)};d.isRejected=z;d.reject=j;j.prototype=o(e.prototype,{constructor:{value:j}});d.ref=l;d.master=function(a){return e({isDef:function(){}},function(b){var c=i.call(arguments);return q.apply(void 0,[a].concat(c))},function(){return p(a)})};d.viewInfo=A;d.view=function(a){return A(a).when(function(b){var c;c="function"===b.type?function(){return v(a,void 0,arguments)}:{};var d=b.properties||{};Object.keys(d).forEach(function(b){"function"===d[b]&&(c[b]=
function(){return E(a,b,arguments)})});return l(c)})};d.when=g;d.spread=function(a,b,c){return g(a,function(a){return b.apply(void 0,a)},c)};d.async=function(a){return function(){var b=function(a,b){var i;try{i=c[a](b)}catch(h){return"[object StopIteration]"===Object.prototype.toString.call(h)?h.value:j(h)}return g(i,d,e)},c=a.apply(this,arguments),d=b.bind(b,"send"),e=b.bind(b,"throw");return d()}};d.Method=m;d.send=q;d.get=m("get");d.put=m("put");d.del=m("del");var E=d.post=m("post");d.invoke=function(a,
b){var c=i.call(arguments,2);return E(a,b,c)};var v=d.apply=m("apply");d.call=function(a,b){var c=i.call(arguments,2);return v(a,b,c)};d.keys=m("keys");d.all=function(a){return g(a,function(a){var c=a.length;if(0===c)return l(a);var d=h();s.call(a,function(e,h,i){g(h,function(e){a[i]=e;0===--c&&d.resolve(a)}).fail(d.reject)},void 0);return d.promise})};d.fail=function(a,b){return g(a,void 0,b)};d.fin=function(a,b){return g(a,function(a){return g(b(),function(){return a})},function(a){return g(b(),
function(){return j(a)})})};d.end=function(a){g(a,void 0,function(a){k(function(){throw a;})})};d.timeout=function(a,b){var c=h();g(a,c.resolve,c.reject);setTimeout(function(){c.reject("Timed out")},b);return c.promise};d.delay=function(a,b){void 0===b&&(b=a,a=void 0);var c=h();setTimeout(function(){c.resolve(a)},b);return c.promise};d.node=B;d.ncall=function(a,b){var c=i.call(arguments,2);return B(a).apply(b,c)}});

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