# Helpers

# The options-parameter

In addition to the parameters used in the helper-call, an options-object is passed to the helper as additional parameter.

  • lookupProperty(object, propertyName): a function that returns an "own property" of an object. Whitelists specified in allowedProtoProperties and allowedProtoMethods are respected by this function. Example:

    preparationScript
    Handlebars.registerHelper('lookupOrDefault', function (object, propertyName, defaultValue, options) {
        var result = options.lookupProperty(object, propertyName)
        if (result != null) {
            return result
        }
        return defaultValue
    })
    
  • TODO: Describe all options that are passed to helpers

Last Updated: 1/8/2020, 11:12:05 PM