/
opt
/
canhelp
/
node_modules
/
next
/
dist
/
shared
/
lib
/
page-path
/
/opt/canhelp/node_modules/next/dist/shared/lib/page-path
mkdir
upload
Name
Size
Mode
Actions
absolute-path-to-page.d.ts
1003
0644
edit
dl
rm
absolute-path-to-page.js
1176
0644
edit
dl
rm
absolute-path-to-page.js.map
2349
0644
edit
dl
rm
denormalize-app-path.d.ts
70
0644
edit
dl
rm
denormalize-app-path.js
433
0644
edit
dl
rm
denormalize-app-path.js.map
464
0644
edit
dl
rm
denormalize-page-path.d.ts
353
0644
edit
dl
rm
denormalize-page-path.js
611
0644
edit
dl
rm
denormalize-page-path.js.map
1085
0644
edit
dl
rm
ensure-leading-slash.d.ts
225
0644
edit
dl
rm
ensure-leading-slash.js
524
0644
edit
dl
rm
ensure-leading-slash.js.map
572
0644
edit
dl
rm
get-page-paths.d.ts
617
0644
edit
dl
rm
get-page-paths.js
1168
0644
edit
dl
rm
get-page-paths.js.map
1993
0644
edit
dl
rm
normalize-data-path.d.ts
133
0644
edit
dl
rm
normalize-data-path.js
655
0644
edit
dl
rm
normalize-data-path.js.map
890
0644
edit
dl
rm
normalize-page-path.d.ts
451
0644
edit
dl
rm
normalize-page-path.js
988
0644
edit
dl
rm
normalize-page-path.js.map
1898
0644
edit
dl
rm
normalize-path-sep.d.ts
228
0644
edit
dl
rm
normalize-path-sep.js
505
0644
edit
dl
rm
normalize-path-sep.js.map
549
0644
edit
dl
rm
remove-page-path-tail.d.ts
651
0644
edit
dl
rm
remove-page-path-tail.js
649
0644
edit
dl
rm
remove-page-path-tail.js.map
1500
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js.map
(2349B)
{"version":3,"sources":["../../../../src/shared/lib/page-path/absolute-path-to-page.ts"],"sourcesContent":["import { ensureLeadingSlash } from './ensure-leading-slash'\nimport { normalizePathSep } from './normalize-path-sep'\nimport path from '../isomorphic/path'\nimport { removePagePathTail } from './remove-page-path-tail'\nimport { normalizeMetadataRoute } from '../../../lib/metadata/get-metadata-route'\nimport type { PAGE_TYPES } from '../../../lib/page-types'\n\n/**\n * Given the absolute path to the pages folder, an absolute file path for a\n * page and the page extensions, this function will return the page path\n * relative to the pages folder. It doesn't consider index tail. Example:\n * - `/Users/rick/my-project/pages/foo/bar/baz.js` -> `/foo/bar/baz`\n *\n * It also handles special metadata routes mapping. Example:\n * - `/Users/rick/my-project/app/sitemap.js` -> `/sitemap/route`\n *\n * @param filepath Absolute path to the page.\n * @param opts.dir Absolute path to the pages/app folder.\n * @param opts.extensions Extensions allowed for the page.\n * @param opts.keepIndex When true the trailing `index` kept in the path.\n * @param opts.pagesType Whether the page is in the pages or app directory.\n */\nexport function absolutePathToPage(\n pagePath: string,\n options: {\n extensions: string[] | readonly string[]\n keepIndex: boolean\n dir: string\n pagesType: PAGE_TYPES\n }\n) {\n const isAppDir = options.pagesType === 'app'\n const page = removePagePathTail(\n normalizePathSep(ensureLeadingSlash(path.relative(options.dir, pagePath))),\n {\n extensions: options.extensions,\n keepIndex: options.keepIndex,\n }\n )\n return isAppDir ? normalizeMetadataRoute(page) : page\n}\n"],"names":["absolutePathToPage","pagePath","options","isAppDir","pagesType","page","removePagePathTail","normalizePathSep","ensureLeadingSlash","path","relative","dir","extensions","keepIndex","normalizeMetadataRoute"],"mappings":";;;;+BAsBgBA;;;eAAAA;;;;oCAtBmB;kCACF;+DAChB;oCACkB;kCACI;AAkBhC,SAASA,mBACdC,QAAgB,EAChBC,OAKC;IAED,MAAMC,WAAWD,QAAQE,SAAS,KAAK;IACvC,MAAMC,OAAOC,IAAAA,sCAAkB,EAC7BC,IAAAA,kCAAgB,EAACC,IAAAA,sCAAkB,EAACC,aAAI,CAACC,QAAQ,CAACR,QAAQS,GAAG,EAAEV,aAC/D;QACEW,YAAYV,QAAQU,UAAU;QAC9BC,WAAWX,QAAQW,SAAS;IAC9B;IAEF,OAAOV,WAAWW,IAAAA,wCAAsB,EAACT,QAAQA;AACnD","ignoreList":[0]}
Save
cmd:
run