ExpressionParser
Secure expression parser that uses AST-based evaluation instead of eval() or new Function()
This parser provides:
- Security: No arbitrary code execution, only whitelisted operations
- Performance: AST caching for repeated expressions
- Better errors: Clear error messages with position information
- Type safety: Strongly typed AST and evaluation
Static Methods
static clearCache() |
|---|
Clear the AST cache |
Presentation |
Returnsvoid |
static evaluate() | |||||||||
|---|---|---|---|---|---|---|---|---|---|
Evaluate an expression with a given scope | |||||||||
Presentation | |||||||||
Parameters
Returnsunknown |
static getCacheStats() |
|---|
Get cache statistics |
Presentation |
Returns{ size: number; maxSize: number; } |