
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
axiom-rule-engine
Advanced tools
--- #### Author : Axiom ##### Created on : 2th Nov 2015 <!-- ##### Update Date : 24th Nov 2015 --> --- This Rules Engine is used to bind the rules and gets the result based on rules. It have 'RulesEngine()' function which returns 'RE' Object. You req
This Rules Engine is used to bind the rules and gets the result based on rules. It have 'RulesEngine()' function which returns 'RE' Object. You require to import 'assertHelper.js' file for use this rules engine library.It is also require user to set defaultResult before using getResult() method.
To use RulesEngine Library you require to create RulesEngine instance through that you can call it's functions.
Example
var RulesEngine = new RulesEngine();
Here 'RulesEngine' is instance through this you can Call RulesEngine functions.
This method is used to add rules into 'RulesEngine' Object.It returns index of current rule into 'RulesEngine' object
Parameter Name | Descriptions |
---|---|
rule | This contains array of JSON objects that defines rule |
result | This contains JSON objects that defines result with respect to given rule |
Parameter | Attributes | DataType | Possible Values |
---|---|---|---|
rule | field | string | Any |
filterType | string | between, in, notin, lt, lteq, gt, gteq, eq, nteq | |
value | array | Any | |
result | Any | Any | Any |
Example
RulesEngine.addRule([{field:"growth",filterType:"between",value:[26, 35]},
{field:"slope",filterType:"between",value:[26,35]}],
{'Color': '#1A9850','Comment': 'Between'});
Here,rule is binded for
1> growth is Between 26 to 35.
2> slope is Between 26 to 35.
with result 'Color'='#1A9850' and 'Comment'='Between'
This method is used to remove the rule from specific index of 'RulesEngine' object.
Parameter Name | Descriptions |
---|---|
index | This defines index of rules into 'RulesEngine' object |
RulesEngine.removeRule(0);
Here, It will remove first rule from index 0 of 'RulesEngine' object.
This method compare the given value with predefined rules and gives result object based on comaprision
Parameter Name | Descriptions |
---|---|
values | This defines JSON object which contains values to be compare against rules. |
RulesEngine.addRule([{field:"growth",filterType:"between",value:[26, 35]},
{field:"slope",filterType:"between",value:[26,35]}],
{'Color': '#1A9850','Comment': 'Between'});
retRestult=RulesEngine.getResult({growth:26,slope:29});
Here,
retRestult.Color contains '#1A9850' and retRestult.Comment contains 'Between'
This method print Entire rules with result and also defaultResult.
RulesEngine.print()
defaultResult variable defines default result when no rules mathced.You must require to set default result before use getResult method.
RulesEngine.defaultResult={'Color': '#D73027','Comment': 'Default Message'};
This method is used to get rule from specific index.
Parameter Name | Descriptions |
---|---|
index | This defines index of rules into 'RulesEngine' object |
RulesEngine.getRule(0)
Here, It will return first rule from index 0 of 'RulesEngine' object.
This method is used to get all rules of 'RulesEngine' object.
RulesEngine.getAllRules()
Here, It will return all rules of 'RulesEngine' object.
FAQs
--- #### Author : Axiom ##### Created on : 2th Nov 2015 <!-- ##### Update Date : 24th Nov 2015 --> --- This Rules Engine is used to bind the rules and gets the result based on rules. It have 'RulesEngine()' function which returns 'RE' Object. You req
The npm package axiom-rule-engine receives a total of 118 weekly downloads. As such, axiom-rule-engine popularity was classified as not popular.
We found that axiom-rule-engine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.