🐛 Correction du court-circuit de toutes ces conditions
parent
c31ad502b7
commit
1db38a6910
|
@ -222,8 +222,24 @@ export let mecanismAllOf = (recurse, k, v) => {
|
|||
/>
|
||||
)
|
||||
|
||||
|
||||
let evaluate = (situationGate, parsedRules, node) => {
|
||||
let evaluateOne = child => evaluateNode(situationGate, parsedRules, child),
|
||||
explanation = R.map(evaluateOne, node.explanation),
|
||||
values = R.pluck('nodeValue', explanation),
|
||||
nodeValue = R.any(R.equals(false), values)
|
||||
? false // court-circuit
|
||||
: R.any(R.equals(null), values) ? null : true
|
||||
|
||||
let collectMissing = node =>
|
||||
node.nodeValue == null
|
||||
? R.chain(collectNodeMissing, node.explanation)
|
||||
: []
|
||||
return rewriteNode(node, nodeValue, explanation, collectMissing)
|
||||
}
|
||||
|
||||
return {
|
||||
evaluate: evaluateArray(R.and, true),
|
||||
evaluate: evaluate,
|
||||
jsx,
|
||||
explanation,
|
||||
category: 'mecanism',
|
||||
|
|
Loading…
Reference in New Issue