CacheControl / CacheControl/json-rules-engine

Inclue RHS factResult after condition evaluation

オープン
#279 コメント 2 件 リアクション 0 件 担当者 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 を短くまとめたダイジェスト。