Comparing version 3.1.0 to 3.1.1
@@ -28,3 +28,3 @@ (function(self) { | ||
if (typeof logic === 'function') | ||
if (typeof logic === 'function' || (logic && typeof logic.then === 'function')) | ||
return clues({},logic,$global,caller,fullref) | ||
@@ -31,0 +31,0 @@ .then(function(logic) { |
{ | ||
"name": "clues", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -58,3 +58,10 @@ var clues = require('../clues'), | ||
}); | ||
var $global = {res:res,req:req,input:req.body}, | ||
facts = (typeof(api) === 'function') | ||
? clues({},api,$global,'reptiles') | ||
: Object.create(api); | ||
$global.root = facts; | ||
// The api request is either determined by options.select, req.param.fn or by remaining url | ||
@@ -64,4 +71,3 @@ var data = (options.select || (req.params.fn || req.url.slice(1).replace(/\//g,'.').replace(/\?.*/,'')).split(',')) | ||
ref = ref.replace(/\//g,'.'); | ||
var facts = typeof(api) === 'object' ? Object.create(api) : api; | ||
return clues(facts,ref,{res:res,req:req,input:req.body,$root:facts},'__user__') | ||
return clues(facts,ref,$global,'__user__') | ||
.catch(stringifyError) | ||
@@ -68,0 +74,0 @@ .then(function(d) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84430
27
1300