ValidationConfig
Defined in: packages/engine/src/constants/Configuration.ts:100
Bounds on untrusted input: expression length and nesting depth.
Properties
Section titled “Properties”autoBalanceParens
Section titled “autoBalanceParens”readonly autoBalanceParens: boolean;Defined in: packages/engine/src/constants/Configuration.ts:116
Auto-balance unmatched parentheses by appending missing closing parens or prepending missing opening parens. When disabled, unbalanced expressions cause parse errors instead of being silently corrected.
Disabled by default for strict parsing. Enable for forgiving user input (e.g., chat-style calculators where users often omit closing parens). Has zero overhead when disabled, the O(n) paren-count scan is skipped.
maxComplexity
Section titled “maxComplexity”readonly maxComplexity: number;Defined in: packages/engine/src/constants/Configuration.ts:104
Maximum expression complexity score (tokens + functionCalls×5 + nestingDepth×10). Protects against deeply nested or combinatorially complex expressions.
maxExpressionLength
Section titled “maxExpressionLength”readonly maxExpressionLength: number;Defined in: packages/engine/src/constants/Configuration.ts:102
Maximum expression length in characters. Prevents excessively long strings from entering the pipeline.
maxNestingDepth
Section titled “maxNestingDepth”readonly maxNestingDepth: number;Defined in: packages/engine/src/constants/Configuration.ts:106
Maximum parentheses nesting depth. Prevents stack overflow in the recursive-descent parser.