When set to a truthy value, we throw a ReferenceError
for invalid paths and refs.
When set to a falsy value, we use an empty string for paths and refs that don't exist in the scope.
If a value does not exist in the scope, two things can happen:
validateRef
is falsy, the value will be assumed empty stringvalidateRef
is truthy, a ReferenceError
will be thrown
Drilling a nested object to get the value assigned with a ref is a relatively expensive computation. Therefore you can set a value of how deep you are expecting a template to go and if the nesting is deeper than that, the computation stops with an error. This prevents a malicious or erroneous template with deep nesting to block the JavaScript event loop. The default is 10.