Overview
PathResolver provides secure dot-notation path resolution with caching and prototype pollution protection.Note: PathResolver is used internally by RuleEngine. You typically use
engine.resolvePath() instead of accessing PathResolver directly.resolvePath()
Resolve a dot-notation path to a value.Parameters
object
required
Object to resolve path in
string
required
Dot-notation path (e.g., ‘user.profile.name’)
any
Value to return if path doesn’t exist
Returns
Resolved value ordefaultValue if path doesn’t exist.
Examples
- Basic
- Missing Paths
- Arrays
- Nested Objects
Security Features
Prototype Pollution Protection
PathResolver blocks dangerous paths by default:Function Blocking
Functions are blocked by default:Caching
PathResolver caches resolutions for performance:Clear Cache
Advanced Usage
Direct PathResolver Access
Literal Values
Configuration
Configure via engine config:Common Patterns
Safe Property Access
Safe Property Access
Dynamic Paths
Dynamic Paths
Validation
Validation
Error Handling
PathResolver doesn’t throw errors - it returnsundefined or defaultValue:
Related
RuleEngine API
Main engine API
Security Guide
Security best practices
