Overview
The PathResolver handles safe resolution of dot-notation paths in nested data structures. It provides caching, security features, and protection against common vulnerabilities.The PathResolver is automatically used by the Rule Engine for all data access. You rarely need to
interact with it directly.
Features
Dot Notation
Access nested data with simple path strings like
user.profile.emailSecurity First
Built-in protection against prototype pollution and malicious access
Performance Caching
LRU cache for frequently accessed paths
Array Access
Support for array index notation like
users[0].namePath Syntax
Basic Paths
Array Paths
Undefined Paths
Security Features
Prototype Pollution Protection
__proto__constructorprototype
Function Access Prevention
Caching
The PathResolver uses an LRU cache to optimize performance:Configuration
boolean
default:"true"
Enable LRU caching for path resolution
number
default:"500"
Maximum number of paths to cache
boolean
default:"false"
Allow access to prototype properties (dangerous - keep false in production)
boolean
default:"false"
Allow resolution of function properties
Direct Usage
While the PathResolver is used automatically by the engine, you can access it directly:Performance Tips
Consistent Paths
Use consistent path strings to maximize cache hits
Shallow Access
Prefer shallower paths when possible for faster resolution
Avoid Deep Nesting
Excessive nesting (>5 levels) impacts performance
Monitor Cache
Check cache stats to optimize cache size
Common Patterns
Safe Property Access
Dynamic Path Building
Validation
Next Steps
Rule Engine
Learn how the engine uses PathResolver
Security Guide
Deep dive into security features
