/opt/canhelp/node_modules/next/dist/esm/shared/lib/page-path
NameSizeModeActions
absolute-path-to-page.js14640644editdlrm
absolute-path-to-page.js.map24140644editdlrm
denormalize-app-path.js2070644editdlrm
denormalize-app-path.js.map4470644editdlrm
denormalize-page-path.js6470644editdlrm
denormalize-page-path.js.map11080644editdlrm
ensure-leading-slash.js3060644editdlrm
ensure-leading-slash.js.map5570644editdlrm
get-page-paths.js12830644editdlrm
get-page-paths.js.map20150644editdlrm
normalize-data-path.js4810644editdlrm
normalize-data-path.js.map8940644editdlrm
normalize-page-path.js11240644editdlrm
normalize-page-path.js.map19350644editdlrm
normalize-path-sep.js2910644editdlrm
normalize-path-sep.js.map5340644editdlrm
remove-page-path-tail.js9090644editdlrm
remove-page-path-tail.js.map15140644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/esm/shared/lib/page-path/absolute-path-to-page.js (1464B)
import { ensureLeadingSlash } from './ensure-leading-slash'; import { normalizePathSep } from './normalize-path-sep'; import path from '../isomorphic/path'; import { removePagePathTail } from './remove-page-path-tail'; import { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'; /** * Given the absolute path to the pages folder, an absolute file path for a * page and the page extensions, this function will return the page path * relative to the pages folder. It doesn't consider index tail. Example: * - `/Users/rick/my-project/pages/foo/bar/baz.js` -> `/foo/bar/baz` * * It also handles special metadata routes mapping. Example: * - `/Users/rick/my-project/app/sitemap.js` -> `/sitemap/route` * * @param filepath Absolute path to the page. * @param opts.dir Absolute path to the pages/app folder. * @param opts.extensions Extensions allowed for the page. * @param opts.keepIndex When true the trailing `index` kept in the path. * @param opts.pagesType Whether the page is in the pages or app directory. */ export function absolutePathToPage(pagePath, options) { const isAppDir = options.pagesType === 'app'; const page = removePagePathTail(normalizePathSep(ensureLeadingSlash(path.relative(options.dir, pagePath))), { extensions: options.extensions, keepIndex: options.keepIndex }); return isAppDir ? normalizeMetadataRoute(page) : page; } //# sourceMappingURL=absolute-path-to-page.js.map