function cleanMapOfRules(d, path) {
  /** @type {Record<string, Rule>} */
  const copy = {}

  for (const key of Object.keys(d)) {
    const cleaned = cleanRule(d[key], path + '.' + key)
    if (Object.keys(cleaned).length > 0) {
      copy[key] = cleaned
    }
  }

  return copy
}
@param {Record<string, Rule>} d
  Map of rules to clean.
@param {string} path
  Path.
@returns {Record<string, Rule>}
  Cleaned map of rules.