detect-locale-cookie.js 386 B

1234567891011
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.detectLocaleCookie = detectLocaleCookie;
  6. function detectLocaleCookie(req, locales) {
  7. const { NEXT_LOCALE } = req.cookies || {};
  8. return NEXT_LOCALE ? locales.find((locale)=>NEXT_LOCALE.toLowerCase() === locale.toLowerCase()) : undefined;
  9. }
  10. //# sourceMappingURL=detect-locale-cookie.js.map