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

clues

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clues - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

6

clues.js

@@ -17,3 +17,3 @@ /**

clues.version = "1.0.0";
clues.version = "1.0.1";

@@ -103,6 +103,4 @@ function clues(logic,facts) {

.then(null,function(e) {
// Convert error object to text
if (e.message) e = e.message;
// Add a reference, if it doesn't exist
if (!e.ref) e= {ref:ref,err:e};
if (!e.err) e= {ref:ref,err:e};
throw e;

@@ -109,0 +107,0 @@ });

@@ -5,2 +5,2 @@ /**

*/
(function(e){function t(e,r){return this instanceof t?(this.logic=e||("undefined"==typeof window?{}:window),this.facts=r||{},void 0):new t(e,r)}function r(e){if(e.__args__)return e.__args__;var t=i.exec(""+e.prototype.constructor);return e.__args__=t[1].replace(/\s/g,"").split(",")}var n;"undefined"!=typeof module?(n=require("q"),module.exports=t):(n=e.Q,e.clues=t),t.version="0.0.7";var i=/function.*?\((.*?)\).*/;t.prototype.solve=function(e,t){var n,i=this,f=i.adapter,l=f.pending();if(t=t||{},"function"!=typeof e){if(n=e,t[n])return f.fulfilled(t[n]);if(void 0!==i.facts[n])return f.fulfilled(i.facts[n]);if(void 0===i.logic[n])return f.rejected({ref:n,err:"not defined"});if("function"!=typeof i.logic[n])return f.fulfilled(i.logic[n]);i.facts[n]=l.promise,l.promise.then(function(e){i.facts[n]=e}),e=i.logic[n]}var o={ref:n,self:i,local:t,facts:i.facts,promise:l.promise,fulfill:l.fulfill,reject:l.reject,callback:function(e,t){e?l.reject(e):l.fulfill(t)}};o.resolve=o.success=o.fulfill,o.error=o.reject;var u=r(e).filter(function(e){return e.length}).map(function(e){return"all"==e?i.all():o[e]||i.solve(e,t)});return this.join(u).then(function(){var t=i.wrap.call(o,e,u);void 0!==t&&(t.then?t.then(l.fulfill,l.reject):l.fulfill(t))}).then(null,function(e){l.reject(e)}),l.promise.then(null,function(e){throw e.message&&(e=e.message),e.ref||(e={ref:n,err:e}),e})},t.prototype.wrap=function(e,t){return e.apply(this,t)},t.prototype.all=function(e){var t,r=this;return t=Object.keys(r.logic).map(function(t){return r.solve(t,e)}),r.join.call(this,t).then(function(){return r.facts})},t.prototype.as=function(e){var t=this,r=t.adapter.pending();return t.facts[e]=r.promise,function(n,i){n?r.reject(n):r.fulfill(i),t.facts[e]=i}},"undefined"!==n&&(t.prototype.adapter={fulfilled:n.resolve,rejected:n.reject,pending:function(){var e=n.defer();return{promise:e.promise,fulfill:e.resolve,reject:e.reject}}}),t.prototype.join=function(e){var t=e.length,r=this.adapter.pending();return t||r.fulfill([]),e.forEach(function(n,i){return n.then?(n.then(function(n){return e[i]=n,!(t-=1)&&r.fulfill(e)},r.reject),void 0):!(t-=1)&&r.fulfill(e)}),r.promise}})(this);
(function(e){function t(e,r){return this instanceof t?(this.logic=e||("undefined"==typeof window?{}:window),this.facts=r||{},void 0):new t(e,r)}function r(e){if(e.__args__)return e.__args__;var t=i.exec(""+e.prototype.constructor);return e.__args__=t[1].replace(/\s/g,"").split(",")}var n;"undefined"!=typeof module?(n=require("q"),module.exports=t):(n=e.Q,e.clues=t),t.version="1.0.1";var i=/function.*?\((.*?)\).*/;t.prototype.solve=function(e,t){var n,i=this,f=i.adapter,l=f.pending();if(t=t||{},"function"!=typeof e){if(n=e,t[n])return f.fulfilled(t[n]);if(void 0!==i.facts[n])return f.fulfilled(i.facts[n]);if(void 0===i.logic[n])return f.rejected({ref:n,err:"not defined"});if("function"!=typeof i.logic[n])return f.fulfilled(i.logic[n]);i.facts[n]=l.promise,l.promise.then(function(e){i.facts[n]=e}),e=i.logic[n]}var o={ref:n,self:i,local:t,facts:i.facts,promise:l.promise,fulfill:l.fulfill,reject:l.reject,callback:function(e,t){e?l.reject(e):l.fulfill(t)}};o.resolve=o.success=o.fulfill,o.error=o.reject;var u=r(e).filter(function(e){return e.length}).map(function(e){return"all"==e?i.all():o[e]||i.solve(e,t)});return this.join(u).then(function(){var t=i.wrap.call(o,e,u);void 0!==t&&(t.then?t.then(l.fulfill,l.reject):l.fulfill(t))}).then(null,function(e){l.reject(e)}),l.promise.then(null,function(e){throw e.err||(e={ref:n,err:e}),e})},t.prototype.wrap=function(e,t){return e.apply(this,t)},t.prototype.all=function(e){var t,r=this;return t=Object.keys(r.logic).map(function(t){return r.solve(t,e)}),r.join.call(this,t).then(function(){return r.facts})},t.prototype.as=function(e){var t=this,r=t.adapter.pending();return t.facts[e]=r.promise,function(n,i){n?r.reject(n):r.fulfill(i),t.facts[e]=i}},"undefined"!==n&&(t.prototype.adapter={fulfilled:n.resolve,rejected:n.reject,pending:function(){var e=n.defer();return{promise:e.promise,fulfill:e.resolve,reject:e.reject}}}),t.prototype.join=function(e){var t=e.length,r=this.adapter.pending();return t||r.fulfill([]),e.forEach(function(n,i){return n.then?(n.then(function(n){return e[i]=n,!(t-=1)&&r.fulfill(e)},r.reject),void 0):!(t-=1)&&r.fulfill(e)}),r.promise}})(this);
{
"name": "clues",
"version": "1.0.0",
"version": "1.0.1",
"description": "Lightweight dependency solver for aync functions, using promises.",

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

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