weploy-translate
Version:
Translate your React.js or Next.js app with AI
14 lines (10 loc) • 422 B
JavaScript
const { getGlobalseoOptions } = require("../configs")
function getUnprefixedPathname(window, prefix, pathname) {
const thePathname = pathname || window.location.pathname
const domainSourcePrefix = prefix || getGlobalseoOptions(window)?.domainSourcePrefix
if (!domainSourcePrefix) {
return thePathname
}
return thePathname.replace(`/${domainSourcePrefix}/`, "/")
}
module.exports = getUnprefixedPathname