function processTemplate(template, variables) {
  for (let variableName of Object.keys(variables)) {
    let value = variables[variableName];
    template = replaceVariable(template, variableName, value);
  }

  template = evaluateConditions(template, variables);

  return template;
}
function processTemplate(template, variables) {
  for (let variableName of Object.keys(variables)) {
    let value = variables[variableName];
    template = replaceVariable(template, variableName, value);
  }

  template = evaluateConditions(template, variables);

  return template;
}
function processTemplate ( template , variables ) { for ( let variableName of Object . keys ( variables ) ) { let value = variables [ variableName ] ; template = replaceVariable ( template , variableName , value ) ; } template = evaluateConditions ( template , variables ) ; return template ; }
Processes the provided template, replacing variable placeholders with the
values of the variables, and evaluating all conditions.

@param {string} template The template.
@param {Object<string, *>} variables The variables and their values.
@return {string} The processed template.
Processes the provided template replacing variable placeholders with the values of the variables and evaluating all conditions .