Open Azuri opened 9 years ago
var flow = require('nools').flow('flow', function(flow){ flow.rule('rule', { scope:{ Math:Math } }, [Number, 'n', 'Math.floor(n*n) > 10'], function(facts){ //... }); }); flow.getSession(Math.PI).match().then(function(){ });
Throws
Error: Invalid expression 'Math.floor(n*n) > 10'
You're right, there is a problem here.
Until this gets done, programmatically with a custom constraint, you can do:
[Number, 'n', function(facts){ return Math.floor( facts.n * facts.n) > 10 }]
Throws