import { CustomDetector , DetectorOptions } from 'i18next-browser-languagedetector' ; import get from 'lodash.get' ; import { COOKIE_LOOKUP_KEY_LANG } from '../index' ; param serverCookies private export const _resolveServerCookie = ( serverCookies ) : string | undefined => { return get ( serverCookies , COOKIE_LOOKUP_KEY_LANG , undefined ) ; } ; export const serverCookie = ( serverCookies ) : CustomDetector => { return { name : 'serverCookie' , lookup : ( options ) : string | undefined => { return _resolveServerCookie ( serverCookies ) ; } , cacheUserLanguage : ( ) : void => { } , } ; } ; export default serverCookie ;