Comparing version 3.5.47 to 3.5.48
@@ -157,3 +157,3 @@ (function(self) { | ||
args = (/constructor\s*\((.*?)\)/.exec(fn.toString()) || [])[1]; | ||
args = args ? args.split(',') : []; | ||
args = args ? args.split(',').map(function(d) { return d.trim(); }) : []; | ||
return [logic].concat(args).concat(function() { | ||
@@ -160,0 +160,0 @@ args = [null].concat(Array.prototype.slice.call(arguments)); |
{ | ||
"name": "clues", | ||
"version": "3.5.47", | ||
"version": "3.5.48", | ||
"description": "Lightweight logic tree solver using promises.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
[![NPM Version][npm-image]][npm-url] | ||
[![NPM Downloads][downloads-image]][downloads-url] | ||
[![Test Coverage][circle-image]][circle-url] | ||
[![Coverage][coverage-image]][coverage-url] | ||
**clues.js** is a lean-mean-promisified-getter-machine that crunches through nested javascript objects, resolving functions (including ES6 arrow functions), values and promises. Clues consists of a single getter function (just under 200 loc) that dynamically resolves dependency trees and memoizes resolutions (derived facts) along the way. It handles the ordering of execution and allows you to think more about the logic of determining the result of a calculation, whether the inputs to those calculations are known values, functions, or asynchronous calls. | ||
@@ -649,1 +651,3 @@ | ||
[downloads-url]: https://npmjs.org/package/clues | ||
[coverage-image]: https://3tjjj5abqi.execute-api.us-east-1.amazonaws.com/prod/clues/badge | ||
[coverage-url]: https://3tjjj5abqi.execute-api.us-east-1.amazonaws.com/prod/clues/url |
@@ -8,5 +8,6 @@ const clues = require('../clues'); | ||
class TestClass { | ||
constructor(d,e) { | ||
constructor(d, e, global_g) { | ||
this.d = d; | ||
this.e = e; | ||
this.g = global_g; | ||
} | ||
@@ -25,3 +26,3 @@ method1(a, b) { | ||
} | ||
f(a,b,c) { return (d,e) => a+b+c+d+e;} | ||
f(a,b,c) { return (d,e,g) => a+b+c+d+e+g;} | ||
met$h_od2 ( a , b ) { | ||
@@ -54,2 +55,6 @@ return a + b; | ||
const $global = { | ||
global_g : 1 | ||
} | ||
t.test('Solving functions of an instance', async t => { | ||
@@ -63,10 +68,10 @@ const facts = new TestClass(); | ||
t.test('with constructor', async t => { | ||
t.same(await clues(a,'class.f'),75); | ||
t.same(await clues(b,'class.f'),94); | ||
t.same(await clues(a,'class.f',$global),76); | ||
t.same(await clues(b,'class.f',$global),95); | ||
}); | ||
t.test('without constructor', async t => { | ||
t.same(await clues(a,'class2.a'),2); | ||
t.same(await clues(a,'class2.a',$global),2); | ||
}); | ||
}); | ||
}); |
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
101593
1801
653