UNPKG

800 BSource Map (JSON)View Raw
1{"version":3,"sources":["../../../../next-server/lib/i18n/detect-locale-cookie.ts"],"names":["detectLocaleCookie","req","locales","NEXT_LOCALE","cookies","find","locale","toLowerCase","undefined"],"mappings":"mFAEO,QAASA,CAAAA,kBAAT,CAA4BC,GAA5B,CAAkDC,OAAlD,CAAqE,CAC1E,KAAM,CAAEC,WAAF,EAAmBF,GAAD,CAAaG,OAAb,EAAwB,EAAhD,CACA,MAAOD,CAAAA,WAAW,CACdD,OAAO,CAACG,IAAR,CACGC,MAAD,EAAoBH,WAAW,CAACI,WAAZ,KAA8BD,MAAM,CAACC,WAAP,EADpD,CADc,CAIdC,SAJJ,CAKD","sourcesContent":["import { IncomingMessage } from 'http'\n\nexport function detectLocaleCookie(req: IncomingMessage, locales: string[]) {\n const { NEXT_LOCALE } = (req as any).cookies || {}\n return NEXT_LOCALE\n ? locales.find(\n (locale: string) => NEXT_LOCALE.toLowerCase() === locale.toLowerCase()\n )\n : undefined\n}\n"]}
\No newline at end of file