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
I was taking a look at the code and you have two method declarations for deletion.
src/engine.js
RuleEngine.deleteRule = function (rule) {
if (_rules[rule.group]) {
_rules[rule.group] = _rules[rule.group].filter(function (arg) {
return rule.group !== arg.group && rule.name !== arg.name
})
}
}
RuleEngine.deleteRule = function (name, group) {
if (_rules[group]) {
_rules[group] = _rules[group].filter(function (arg) {
return group !== arg.group && name !== arg.name
})
}
}
The second declaration will override the first.
In the documentation you are using the (name, group) pattern, so I was going to delete the second, but maybe you are willing to let both available, so you might consider checking if group is set or if the first passed param is an object, or whatever you think fit.
Do you want me to send a pull request for this?
The text was updated successfully, but these errors were encountered:
Hi Anand!
I was taking a look at the code and you have two method declarations for deletion.
src/engine.js
The second declaration will override the first.
In the documentation you are using the (name, group) pattern, so I was going to delete the second, but maybe you are willing to let both available, so you might consider checking if
group
is set or if the first passed param is an object, or whatever you think fit.Do you want me to send a pull request for this?
The text was updated successfully, but these errors were encountered: