Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
27 lines
809 B
Plaintext
27 lines
809 B
Plaintext
function receiveRoutingConfig(input) {
|
|
return {
|
|
...input,
|
|
localePrefix: receiveLocalePrefixConfig(input.localePrefix),
|
|
localeCookie: receiveLocaleCookie(input.localeCookie),
|
|
localeDetection: input.localeDetection ?? true,
|
|
alternateLinks: input.alternateLinks ?? true
|
|
};
|
|
}
|
|
function receiveLocaleCookie(localeCookie) {
|
|
return localeCookie ?? true ? {
|
|
name: 'NEXT_LOCALE',
|
|
sameSite: 'lax',
|
|
...(typeof localeCookie === 'object' && localeCookie)
|
|
|
|
// `path` needs to be provided based on a detected base path
|
|
// that depends on the environment when setting a cookie
|
|
} : false;
|
|
}
|
|
function receiveLocalePrefixConfig(localePrefix) {
|
|
return typeof localePrefix === 'object' ? localePrefix : {
|
|
mode: localePrefix || 'always'
|
|
};
|
|
}
|
|
|
|
export { receiveRoutingConfig };
|