Comparing version 3.3.11 to 3.3.13-timing
{ | ||
"name": "clues", | ||
"version": "3.3.11", | ||
"version": "3.3.13", | ||
"main": "clues.js", | ||
@@ -5,0 +5,0 @@ "scripts": [ |
13
clues.js
@@ -38,3 +38,3 @@ (function(self) { | ||
var dot = ref.search(/ᐅ|\./); | ||
if (dot > -1 && logic[ref] === undefined) { | ||
if (dot > -1 && (!logic || logic[ref] === undefined)) { | ||
var next = ref.slice(0,dot); | ||
@@ -56,5 +56,5 @@ return clues(logic,next,$global,caller,fullref) | ||
fullref = (fullref ? fullref+'.' : '')+ref; | ||
fn = logic[ref]; | ||
fn = logic ? logic[ref] : undefined; | ||
if (fn === undefined) { | ||
if (typeof(logic) === 'object' && Object.getPrototypeOf(logic)[ref] !== undefined) | ||
if (typeof(logic) === 'object' && logic !== null && (Object.getPrototypeOf(logic) || {})[ref] !== undefined) | ||
fn = Object.getPrototypeOf(logic)[ref]; | ||
@@ -119,3 +119,3 @@ else if ($global[ref] && caller && caller !== '__user__') | ||
var inputs = clues.Promise.all(args); | ||
var inputs = clues.Promise.all(args),wait = new Date(),duration; | ||
if (inputs.cancellable) inputs = inputs.cancellable(); | ||
@@ -125,5 +125,8 @@ | ||
.then(function(args) { | ||
return fn.apply(logic, args); | ||
duration = new Date(); | ||
return fn.apply(logic || {}, args); | ||
}) | ||
.then(function(d) { | ||
if (typeof $global.$duration === 'function') | ||
$global.$duration(fullref,[(new Date()-duration),(new Date())-wait]); | ||
return typeof d == 'string' ? d : clues(logic,d,$global,caller,fullref); | ||
@@ -130,0 +133,0 @@ },function(e) { |
{ | ||
"name": "clues", | ||
"version": "3.3.11", | ||
"version": "3.3.13-timing", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -81,6 +81,11 @@ var clues = require('../clues'), | ||
var duration = {}; | ||
var $global = Object.create(options.$global || {},{ | ||
res : {value: res}, | ||
req : {value: req}, | ||
input: {value: req.body} | ||
input: {value: req.body}, | ||
$duration : {value: function(ref,time) { | ||
duration[ref] = time; | ||
}} | ||
}); | ||
@@ -130,2 +135,6 @@ | ||
.then(function() { | ||
var txt = {}; | ||
txt.duration = duration; | ||
txt = stringify(txt,pretty,options.debug); | ||
_res.write(txt.slice(1,txt.length-1)+',\t\n'); | ||
_res.write('"__end__" : true\t\n}'); | ||
@@ -132,0 +141,0 @@ res.end(); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
78975
26
1478
2