/opt/canhelp/node_modules/next/dist/shared/lib/page-path
NameSizeModeActions
absolute-path-to-page.d.ts10030644editdlrm
absolute-path-to-page.js11760644editdlrm
absolute-path-to-page.js.map23490644editdlrm
denormalize-app-path.d.ts700644editdlrm
denormalize-app-path.js4330644editdlrm
denormalize-app-path.js.map4640644editdlrm
denormalize-page-path.d.ts3530644editdlrm
denormalize-page-path.js6110644editdlrm
denormalize-page-path.js.map10850644editdlrm
ensure-leading-slash.d.ts2250644editdlrm
ensure-leading-slash.js5240644editdlrm
ensure-leading-slash.js.map5720644editdlrm
get-page-paths.d.ts6170644editdlrm
get-page-paths.js11680644editdlrm
get-page-paths.js.map19930644editdlrm
normalize-data-path.d.ts1330644editdlrm
normalize-data-path.js6550644editdlrm
normalize-data-path.js.map8900644editdlrm
normalize-page-path.d.ts4510644editdlrm
normalize-page-path.js9880644editdlrm
normalize-page-path.js.map18980644editdlrm
normalize-path-sep.d.ts2280644editdlrm
normalize-path-sep.js5050644editdlrm
normalize-path-sep.js.map5490644editdlrm
remove-page-path-tail.d.ts6510644editdlrm
remove-page-path-tail.js6490644editdlrm
remove-page-path-tail.js.map15000644editdlrm
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]}