Expand description
CRUDUI expression evaluator (expressions.md §5/§6/§7, JS PathResolver parity).
The shared 4-language fixture (tests/fixtures/expr/cases.json) is generated
from the JS reference engine and is the §9 contract all four engines pass, so
this evaluator mirrors validator-ts PathResolver function-for-function:
Evaluator::evaluate→ bool (JSevaluateCondition):Booleanof the resolved value for Path/Literal; logical short-circuit; comparison; in; unary; a ternary isBoolean(its branch value).Evaluator::evaluate_value→ value (JSevaluateExpressionValue): a ternary returns its branch value; EVERYTHING else returns the boolean condition result.
truthy (JS Boolean): null/false/0/“” falsy; “0”, “false”, [], {}, and every
non-empty value truthy. == / != use JS loose equality (same-type ===, else
numeric when both Number()-parse, else string). > >= < <= coerce BOTH sides
to number (parseFloat, NaN→0) and compare numerically — no lexicographic
branch (JS compare parity).
No eval / no regex evaluation (GRAMMAR §10) — a pure AST walk.
Structs§
- Evaluator
- AST evaluator bound to a form-data tree and the current field path.
Functions§
- is_
truthy - Truthy test (JS
Boolean). null/false/0/0.0/“” are falsy; “0”, “false”, empty array, empty object, and every non-empty value are truthy. - relative_
base - The path that a relative path with
levels_upfurther dots starts from: the current field is one level and each further dot moves one more level up, and a row key leaves together with the name of its collection (expressions.md, “Evaluation”).