CacheControl / CacheControl/json-rules-engine

Inclue RHS factResult after condition evaluation

未关闭
#279 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
3.1k
派生
507
PR 合并指标
30 天内没有已合并 PR

描述

We are using the functionality to allow the LHS attribute to be compared to a RHS attribute (demonstrated in [this example](https://github.com/CacheControl/json-rules-engine/blob/90272d61ed7bea8b7d4000305511e932490d2e2e/examples/08-fact-comparison.js)) but noticed that in the rule result, only the LHS factResult is included. Would it be possible to also include the RHS factResult? I am not too familiar with the code but it seems like the logic is contained below

https://github.com/CacheControl/json-rules-engine/blob/90272d61ed7bea8b7d4000305511e932490d2e2e/src/rule.js#L207-L212

and a logic statement along the lines of
`if (condition.value is an object) condition.value.factResult = evaluationResult.rightHandSideValue`
could be added?

If there are no issues with this I am happy to open a PR

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。