function transformTemplate(template, data, rules = {}) {
  return template.replace(/\${(.*?)}/g, (_, key) => {
    if (key in data) {
      if (key in rules) {
        return rules[key](data[key])
      } else {
        return data[key] ?? 'unknown'
      }
    } else {
      return 'unknown'
    }
  })
}
Transforms a template string by replacing placeholders with values from the data object.
If a key is not found in the data object, it returns 'unknown'.
If a key is found in the rules object, it applies the corresponding function to the value.
@param {string} template - The template string containing placeholders in the format ${key}.
@param {Object} data - An object containing key-value pairs to replace in the template.
@param {Object} rules - An optional object containing functions to apply to specific keys.
@returns {string} - The transformed string with placeholders replaced by corresponding values.