/
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/normalize-page-path.js.map
(1898B)
{"version":3,"sources":["../../../../src/shared/lib/page-path/normalize-page-path.ts"],"sourcesContent":["import { ensureLeadingSlash } from './ensure-leading-slash'\nimport { isDynamicRoute } from '../router/utils'\nimport { NormalizeError } from '../utils'\n\n/**\n * Takes a page and transforms it into its file counterpart ensuring that the\n * output is normalized. Note this function is not idempotent because a page\n * `/index` can be referencing `/index/index.js` and `/index/index` could be\n * referencing `/index/index/index.js`. Examples:\n * - `/` -> `/index`\n * - `/index/foo` -> `/index/index/foo`\n * - `/index` -> `/index/index`\n */\nexport function normalizePagePath(page: string): string {\n const normalized =\n /^\\/index(\\/|$)/.test(page) && !isDynamicRoute(page)\n ? `/index${page}`\n : page === '/'\n ? '/index'\n : ensureLeadingSlash(page)\n\n if (process.env.NEXT_RUNTIME !== 'edge') {\n const { posix } = require('path') as typeof import('path')\n const resolvedPage = posix.normalize(normalized)\n if (resolvedPage !== normalized) {\n throw new NormalizeError(\n `Requested and resolved page mismatch: ${normalized} ${resolvedPage}`\n )\n }\n }\n\n return normalized\n}\n"],"names":["normalizePagePath","page","normalized","test","isDynamicRoute","ensureLeadingSlash","process","env","NEXT_RUNTIME","posix","require","resolvedPage","normalize","NormalizeError"],"mappings":";;;;+BAagBA;;;eAAAA;;;oCAbmB;uBACJ;wBACA;AAWxB,SAASA,kBAAkBC,IAAY;IAC5C,MAAMC,aACJ,iBAAiBC,IAAI,CAACF,SAAS,CAACG,IAAAA,qBAAc,EAACH,QAC3C,AAAC,WAAQA,OACTA,SAAS,MACP,WACAI,IAAAA,sCAAkB,EAACJ;IAE3B,IAAIK,QAAQC,GAAG,CAACC,YAAY,KAAK,QAAQ;QACvC,MAAM,EAAEC,KAAK,EAAE,GAAGC,QAAQ;QAC1B,MAAMC,eAAeF,MAAMG,SAAS,CAACV;QACrC,IAAIS,iBAAiBT,YAAY;YAC/B,MAAM,IAAIW,sBAAc,CACtB,AAAC,2CAAwCX,aAAW,MAAGS;QAE3D;IACF;IAEA,OAAOT;AACT","ignoreList":[0]}
Save
cmd:
run