When set to a truthy value, rendering literally puts a 'null' or
'undefined' for values that are null
or undefined
.
By default it swallows those values to be compatible with Mustache.
Maximum allowed path. Set this to a safe value to prevent a bad template from blocking the tokenization unnecessarily
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.
The string symbols that mark the opening and closing of a path in the template.
It should be an array of exactly two distinct strings otherwise an error is thrown.
It defaults to ['{{', '}}']
when set to a truthy value, validates the paths
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
The options that customize the tokenization of the template and the renderer object that is returned