next-intl
Version:
Internationalization (i18n) for Next.js
2 lines (1 loc) • 327 B
JavaScript
import{getBasePath as t}from"./utils.js";function e(e,o,n,a){if(!e||!(a!==n&&null!=a)||!o)return;const f=t(o),r=""!==f?f:"/",{name:c,...i}=e;i.path||(i.path=r);let l=`${c}=${a};`;for(const[t,e]of Object.entries(i)){l+=`${"maxAge"===t?"max-age":t}`,"boolean"!=typeof e&&(l+="="+e),l+=";"}document.cookie=l}export{e as default};