function normalizeConfig(config) {
  /** @type {Config} */
  const normalizedConfig = Object.assign(normalizeElementConfig(config), {
    elementOverrides: {},
  });

  if (config.elementOverrides) {
    normalizedConfig.elementOverrides = fromEntries(
      flatMap(
        iterFrom(entries(config.elementOverrides)),
        (entry) => {
          const elementName = entry[0];
          const rawElementConfig = entry[1];

          if (!reOverridableElement.test(elementName)) {
            return [];
          }

          return [[
            elementName,
            Object.assign(normalizeElementConfig(rawElementConfig), {
              type: 'override',
              name: elementName,
              allowElement: !!rawElementConfig.allowElement,
              applyToNestedElements: typeof rawElementConfig.applyToNestedElements === 'undefined' || !!rawElementConfig.applyToNestedElements,
            }),
          ]];
        }
      )
    );
  }

  return normalizedConfig;
}
Normalizes the config and applies default values to all config options
@param {RawConfig} config
@returns {Config}