Files
klz-cables.com/.pnpm-store/v10/files/23/7b6039d9735c9a40f170d6b92ac99cc82ebed15c56ea501a15b5a0fb1ae01ba410f17f4bb2d62750534c73f279ada364f8bb6ea8c65d841c2519ea2799e9e1
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

22 lines
918 B
Plaintext

export const formatAdminURL = (args)=>{
const { adminRoute, apiRoute, includeBasePath: includeBasePathArg, path = '', relative = false, serverURL } = args;
const basePath = process.env.NEXT_BASE_PATH || args.basePath || '';
const routePath = adminRoute || apiRoute;
const segments = [
routePath && routePath !== '/' && routePath,
path && path
].filter(Boolean);
const pathname = segments.join('') || '/';
const pathnameWithBase = (basePath + pathname).replace(/\/$/, '') || '/';
const includeBasePath = includeBasePathArg ?? (adminRoute ? false : true);
if (relative || !serverURL) {
if (includeBasePath && basePath) {
return pathnameWithBase;
}
return pathname;
}
const serverURLObj = new URL(serverURL);
return new URL(pathnameWithBase, serverURLObj.origin).toString();
};
//# sourceMappingURL=formatAdminURL.js.map