import { mapValues, omitBy, pickBy } from 'lodash';
import { isLecacyTranslationObject, translateArrayProperties } from '../useLocalizeConfig';
export default function convertLegacyTranslationsToIntlProps(config) {
  var translatedConfig = omitBy(config, isLecacyTranslationObject);
  var translate = pickBy(config, isLecacyTranslationObject);

  if (Object.keys(translate).length) {
    translatedConfig.intl = translate;
  }

  return mapValues(translatedConfig, function (value, key) {
    return translateArrayProperties.includes(key) ? value.map(function (value) {
      return typeof value === 'object' ? convertLegacyTranslationsToIntlProps(value) : value;
    }) : value;
  });
}
//# sourceMappingURL=convertLegacyTranslationsToIntlProps.js.map