imports/vx/both/code/util.js
/**
     * Resolve variable references within a given string.
     *
     * @param {string} template String containing variables.
     * @param {object} variables Variables and their corresponding values.
     * @return {string} String with variables substituted.
     */
Resolve variable references within a given string.
@param {string} template String containing variables.
@param {object} variables Variables and their corresponding values.
@return {string} String with variables substituted.
Resolve variable references within a given string . @param { string } template String containing variables . @param { object } variables Variables and their corresponding values . @return { string } String with variables substituted .
resolveVariables(template, variables) {
        if (variables) {
            _.each(variables, (variableValue, variableName) => {
                let regex = new RegExp("\\{\\{" + variableName + "\\}\\}", "g")
                template = template.replace(regex, variableValue)
            })
        }
        return template
    }
resolveVariables ( template , variables ) { if ( variables ) { _ . each ( variables , ( variableValue , variableName ) => { let regex = new RegExp ( "\\{\\{" + variableName + "\\}\\}" , "g" ) template = template . replace ( regex , variableValue ) } ) } return template }
Resolve variable references within a given string.
Resolve variable references within a given string .