10 lines
308 B
JavaScript
10 lines
308 B
JavaScript
const absolutePath = ({ currentPath, basePath, relativePath }) => {
|
|
const absolutePath = currentPath.slice(1).split("/")
|
|
absolutePath.pop(); // remove current page name
|
|
absolutePath.unshift(basePath);
|
|
absolutePath.push(relativePath);
|
|
return absolutePath.join("/");
|
|
};
|
|
|
|
export default absolutePath;
|