CacheControl / CacheControl/json-rules-engine
Inclue RHS factResult after condition evaluation
- Langage dominant
- JavaScript
- Étoiles
- 3.1k
- Forks
- 507
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par src/rule.js autour des lignes 207-212 et comparez son comportement avec examples/08-fact-comparison.js. Suivez la manière dont l’évaluation de la condition construit le résultat de la règle, puis vérifiez qu’un factResult du côté droit est inclus en plus du résultat existant du côté gauche.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- backend
- Type d'issue
- Fonctionnalité
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100