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

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 src/rule.js 的第 207-212 行附近開始,並將其行為與 examples/08-fact-comparison.js 進行比較。追蹤條件評估如何建立規則結果,然後確認右側的 factResult 是否與現有的左側結果一同包含在內。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
backend
Issue 類型
功能
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。