CacheControl / CacheControl/json-rules-engine

Inclue RHS factResult after condition evaluation

Offen
#279 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
3.1k
Forks
507
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit src/rule.js bei den Zeilen 207-212 und vergleiche sein Verhalten mit examples/08-fact-comparison.js. Verfolge, wie die Auswertung der Bedingung das Regelergebnis aufbaut, und überprüfe anschließend, dass ein rechtsseitiges factResult zusätzlich zum bestehenden linksseitigen Ergebnis enthalten ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.