ConstantFoldingOptimizer
ConstantFoldingOptimizer inlines constant scalar and aggregate literal values within function calls and select statements with their evaluated result.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConstantFoldingOptimizer(
options?):ConstantFoldingOptimizer
constructor configures constant folding from a plain option object.
Parameters
Section titled “Parameters”options?
Section titled “options?”ConstantFoldingOptimizerOptions = {}
Returns
Section titled “Returns”ConstantFoldingOptimizer
Methods
Section titled “Methods”optimize()
Section titled “optimize()”optimize(
context,ast):AST
optimize queries the expression graph for scalar and aggregate literal expressions within call and select statements, evaluates them, and replaces each call site with its result.
Only values which can be represented as literals in CEL syntax are supported.