bpms_site/.svn/pristine/13/134dc47a9b2f5ce05792108e8de09f043049e2de.svn-base
2025-11-02 16:38:49 +03:30

16 lines
526 B
Plaintext

import { hasBasePath } from "./has-base-path";
const basePath = process.env.__NEXT_ROUTER_BASEPATH || "";
export function removeBasePath(path) {
if (process.env.__NEXT_MANUAL_CLIENT_BASE_PATH) {
if (!hasBasePath(path)) {
return path;
}
}
// Can't trim the basePath if it has zero length!
if (basePath.length === 0) return path;
path = path.slice(basePath.length);
if (!path.startsWith("/")) path = "/" + path;
return path;
}
//# sourceMappingURL=remove-base-path.js.map