You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we pass BigInt value as fact. Getting this error.
Here is the sample code to reproduce this error.
/**
* Setup a new engine
*/
const engine = new Engine();
// define a rule for detecting the player has exceeded foul limits. Foul out any player who:
// (has committed 5 fouls AND game is 40 minutes) OR (has committed 6 fouls AND game is 48 minutes)
engine.addRule({
conditions: {
any: [
{
all: [
{
fact: 'revenue',
operator: 'greaterThan',
value: 5000,
},
],
},
],
},
event: {
// define the event to fire when the conditions evaluate truthy
type: 'fouledOut',
params: {
message: 'Revenue is higher than the expected!',
},
},
});
/**
* Define facts the engine will use to evaluate the conditions above.
* Facts may also be loaded asynchronously at runtime; see the advanced example below
*/
const facts = {
revenue: BigInt(5001),
};
// Define success and failure handlers
engine.on('success', () => {
console.log('success');
});
engine.on('failure', () => {
console.log('failure');
});
// Run the rule engine
await engine.run(facts);
The text was updated successfully, but these errors were encountered:
When we pass
BigInt
value as fact. Getting this error.Here is the sample code to reproduce this error.
The text was updated successfully, but these errors were encountered: