code: function formatTemplate(template, vars, ownPropertiesOnly) {
      if (!vars) return template;
      return template.replace(/%([^%]+)%/g, function (_, key) {
        var valOrFn;
        if (ownPropertiesOnly) {
          valOrFn = vars.hasOwnProperty(key) ? vars[key] : '';
        } else {
          valOrFn = vars[key];
        }
        if (valOrFn != null) {
          if (__isFunction(valOrFn)) {
            return valOrFn(vars);
          } else {
            return valOrFn;
          }
        } else {
          return "";
        }
      });
    }
docs: private funcs