CacheControl / CacheControl/json-rules-engine
Inclue RHS factResult after condition evaluation
- Linguagem predominante
- JavaScript
- Estrelas
- 3.1k
- Forks
- 507
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Direção de pesquisa
Comece por src/rule.js nas proximidades das linhas 207-212 e compare seu comportamento com examples/08-fact-comparison.js. Acompanhe como a avaliação da condição constrói o resultado da regra e, em seguida, verifique se um factResult do lado direito é incluído junto com o resultado existente do lado esquerdo.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript
- Domínio
- backend
- Tipo de issue
- Funcionalidade
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 25/100