"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getNormalizedLocale = void 0;
var _locale = require("@mirai/locale");
var _constants = require("./constants");
const getNormalizedLocale = locale => {
  if (typeof locale !== 'string') return _locale.DEFAULT_LOCALE;
  if (_constants.LOCALES.includes(locale)) return locale;
  const [language] = locale.split('-');
  return _constants.LOCALES.find(item => item.startsWith(language)) || _locale.DEFAULT_LOCALE;
};
exports.getNormalizedLocale = getNormalizedLocale;
//# sourceMappingURL=getNormalizedLocale.js.map