Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
29
node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js
generated
vendored
Normal file
29
node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* Get pathname from absolute path.
|
||||
*
|
||||
* @param absolutePath the absolute path
|
||||
* @returns the pathname
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "getPathnameFromAbsolutePath", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return getPathnameFromAbsolutePath;
|
||||
}
|
||||
});
|
||||
function getPathnameFromAbsolutePath(absolutePath) {
|
||||
// Remove prefix including app dir
|
||||
let appDir = '/app/';
|
||||
if (!absolutePath.includes(appDir)) {
|
||||
appDir = '\\app\\';
|
||||
}
|
||||
const [, ...parts] = absolutePath.split(appDir);
|
||||
const relativePath = appDir[0] + parts.join(appDir);
|
||||
// remove extension
|
||||
const pathname = relativePath.split('.').slice(0, -1).join('.');
|
||||
return pathname;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=get-pathname-from-absolute-path.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue